Skip to content
Commit 88b7e8e0 authored by Nicolas Vasilache's avatar Nicolas Vasilache
Browse files

[mlir][SCF] Add an scf.take_assumed_branch transform op.

Given an scf.if conditional, using this transformation is akin to injecting
user-specified information that it is always safe to execute only the specified
`if` or `else` branch.

This is achieved by just replacing the scf.if by the content of one of its
branches.

This is particularly useful for user-controlled rewriting of conditionals
that exist solely to guard against out-of-bounds behavior.

At the moment, no assume or assert operation is emitted as it is not always
desirable. In the future, this may be controlled by a dedicated attribute.

Differential Revision: https://reviews.llvm.org/D148125
parent 34f57749
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment