[Mlir-commits] [mlir] [mlir][memref] Fix an invalid dim loop motion crash (PR #74204)

Sanjoy Das llvmlistbot at llvm.org
Sat Dec 2 12:59:32 PST 2023


================
@@ -893,8 +893,9 @@ Speculation::Speculatability DimOp::getSpeculatability() {
   if (!rankedSourceType)
     return Speculation::NotSpeculatable;
 
-  // The verifier rejects operations that violate this assertion.
-  assert(constantIndex < rankedSourceType.getRank());
+  if (rankedSourceType.getRank() < constantIndex)
----------------
sanjoy wrote:

Is the comment factually incorrect: `The verifier rejects operations that violate this assertion.`?

Also, I think the condition should be `rankedSourceType.getRank() <= constantIndex`.  Same for the other check.

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


More information about the Mlir-commits mailing list