diff options
author | Matthias Springer <me@m-sp.org> | 2024-04-05 13:14:00 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-05 13:14:00 +0900 |
commit | 6b30ffef28c35c24bfd8190e06eeaa0c5cd73cbd (patch) | |
tree | a5c267162a4206772682036ba866da8fea819a68 /llvm/lib/Bitcode | |
parent | 843cc474faefad1d639f4c44c1cf3ad7dbda76c8 (diff) | |
download | llvm-6b30ffef28c35c24bfd8190e06eeaa0c5cd73cbd.zip llvm-6b30ffef28c35c24bfd8190e06eeaa0c5cd73cbd.tar.gz llvm-6b30ffef28c35c24bfd8190e06eeaa0c5cd73cbd.tar.bz2 |
[mlir][SCF] `ValueBoundsConstraintSet`: Support `scf.if` (branches) (#85895)
This commit adds support for `scf.if` to `ValueBoundsConstraintSet`.
Example:
```
%0 = scf.if ... -> index {
scf.yield %a : index
} else {
scf.yield %b : index
}
```
The following constraints hold for %0:
* %0 >= min(%a, %b)
* %0 <= max(%a, %b)
Such constraints cannot be added to the constraint set; min/max is not
supported by `IntegerRelation`. However, if we know which one of %a and
%b is larger, we can add constraints for %0. E.g., if %a <= %b:
* %0 >= %a
* %0 <= %b
This commit required a few minor changes to the
`ValueBoundsConstraintSet` infrastructure, so that values can be
compared while we are still in the process of traversing the IR/adding
constraints.
Diffstat (limited to 'llvm/lib/Bitcode')
0 files changed, 0 insertions, 0 deletions