[all-commits] [llvm/llvm-project] 6b30ff: [mlir][SCF] `ValueBoundsConstraintSet`: Support `s...

Matthias Springer via All-commits all-commits at lists.llvm.org
Thu Apr 4 21:14:22 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6b30ffef28c35c24bfd8190e06eeaa0c5cd73cbd
      https://github.com/llvm/llvm-project/commit/6b30ffef28c35c24bfd8190e06eeaa0c5cd73cbd
  Author: Matthias Springer <me at m-sp.org>
  Date:   2024-04-05 (Fri, 05 Apr 2024)

  Changed paths:
    M mlir/include/mlir/Interfaces/ValueBoundsOpInterface.h
    M mlir/lib/Dialect/SCF/IR/ValueBoundsOpInterfaceImpl.cpp
    M mlir/lib/Dialect/Vector/IR/ScalableValueBoundsConstraintSet.cpp
    M mlir/lib/Interfaces/ValueBoundsOpInterface.cpp
    M mlir/test/Dialect/SCF/value-bounds-op-interface-impl.mlir

  Log Message:
  -----------
  [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.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list