[Mlir-commits] [mlir] [mlir][affine] Fix crash in linearize_index fold when multi-index is ub.poison (PR #183816)

Matthias Springer llvmlistbot at llvm.org
Sat Feb 28 00:14:42 PST 2026


================
@@ -5298,7 +5298,12 @@ OpFoldResult AffineLinearizeIndexOp::fold(FoldAdaptor adaptor) {
   if (getMultiIndex().size() == 1)
     return getMultiIndex().front();
 
-  if (llvm::is_contained(adaptor.getMultiIndex(), nullptr))
+  // Return nullptr if any multi-index attribute has not been folded to a
+  // concrete integer (e.g. it is still a runtime value or has folded to a
+  // non-integer such as ub.PoisonAttr).
----------------
matthias-springer wrote:

```suggestion
  // non-integer attribute such as #ub.poison).
```

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


More information about the Mlir-commits mailing list