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

Mehdi Amini llvmlistbot at llvm.org
Fri Feb 27 01:49:14 PST 2026


================
@@ -4932,8 +4932,12 @@ foldCstValueToCstAttrBasis(ArrayRef<OpFoldResult> mixedBasis,
                            MutableOperandRange mutableDynamicBasis,
                            ArrayRef<Attribute> dynamicBasis) {
   uint64_t dynamicBasisIndex = 0;
-  for (OpFoldResult basis : dynamicBasis) {
-    if (basis) {
+  for (Attribute basis : dynamicBasis) {
+    // Skip poison values: they don't have a concrete integer value, so erasing
+    // them from the dynamic operands would create an inconsistency between
+    // the static basis (which would still hold kDynamic) and the dynamic
+    // operand list (which would be one element shorter).
+    if (basis && !isa<ub::PoisonAttr>(basis)) {
----------------
joker-eph wrote:

Yeah you're right, done!

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


More information about the Mlir-commits mailing list