[Mlir-commits] [mlir] [ mlir][scf] Allow 'ult'/'ugt' in uplift (PR #139911)

Thomas Raoux llvmlistbot at llvm.org
Wed May 14 10:57:52 PDT 2025


================
@@ -91,9 +91,10 @@ FailureOr<scf::ForOp> mlir::scf::upliftWhileToForLoop(RewriterBase &rewriter,
 
   using Pred = arith::CmpIPredicate;
   Pred predicate = cmp.getPredicate();
-  if (predicate != Pred::slt && predicate != Pred::sgt)
+  if (predicate != Pred::slt && predicate != Pred::sgt &&
+      predicate != Pred::ult && predicate != Pred::ugt)
----------------
ThomasRaoux wrote:

signless means the sign information is held by the operation. The semantic of the op is clarified in the doc:
```
The lower and upper bounds specify a half-open range: the iteration is executed iff the signed comparison of induction variable value is less than the upper bound and bigger or equal to the lower bound.
```

https://github.com/llvm/llvm-project/pull/139911


More information about the Mlir-commits mailing list