[Mlir-commits] [mlir] [MLIR] Add a getStaticTripCount method to LoopLikeOpInterface (PR #158679)

Mehdi Amini llvmlistbot at llvm.org
Tue Sep 16 05:13:08 PDT 2025


================
@@ -105,6 +110,23 @@ static TerminatorTy verifyAndGetTerminator(Operation *op, Region &region,
   return nullptr;
 }
 
+/// Helper function to compute the difference between two values. This is used
+/// by the loop implementations to compute the trip count.
+static std::optional<llvm::APSInt> computeUbMinusLb(Value lb, Value ub,
----------------
joker-eph wrote:

Completely! I need to match the LHS of the add as well.
I'll add a negative test to cover this...

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


More information about the Mlir-commits mailing list