[Mlir-commits] [mlir] [llvm] [lldb] [mlir] Introduce replaceWithZeroTripCheck in LoopLikeOpInterface (PR #80331)

Matthias Springer llvmlistbot at llvm.org
Fri Feb 2 12:29:31 PST 2024


================
@@ -220,6 +220,31 @@ def LoopLikeOpInterface : OpInterface<"LoopLikeOpInterface"> {
       /*defaultImplementation=*/[{
         return ::mlir::failure();
       }]
+    >,
+    InterfaceMethod<[{
+        Add a zero-trip-check around the loop to check if the loop body is ever
----------------
matthias-springer wrote:

Instead of creating a "check" (it is not really clear what the "check" is; it could be an `scf.if`, it could be a new basic block with a conditional branch, etc.), this method could also return just the condition. (Which evaluates to `true` if the loop has at least one iteration.) That would keep the interface a bit simpler. What do you think?


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


More information about the Mlir-commits mailing list