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

Thomas Raoux llvmlistbot at llvm.org
Wed May 14 07:51:01 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:

why is ult/ugt correct? scf::for will do a signed comparison so the new IR is not equivalent.

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


More information about the Mlir-commits mailing list