[Mlir-commits] [mlir] [MLIR][Vector] Fix crash in foldDenseElementsAttrDestInsertOp on poison index (PR #188508)

Andrzej WarzyƄski llvmlistbot at llvm.org
Fri Mar 27 05:02:45 PDT 2026


================
@@ -3807,6 +3807,25 @@ func.func @insert_vector_poison_idx_non_cst(%a: vector<4x5xf32>, %b: vector<5xf3
 
 // -----
 
+// Similar to the test above, but now the destination is a dense constant.
+// foldDenseElementsAttrDestInsertOp must not crash when the dynamic index
+// constant is -1 (the poison sentinel). Instead it should fold to ub.poison.
+// Regression test for https://github.com/llvm/llvm-project/issues/188404
----------------
banach-space wrote:

[nit] I would disambiguate a bit.
```suggestion
// Similar to the test above, but with a dense constant destination. This exercises
// foldDenseElementsAttrDestInsertOp, which must not crash when the dynamic index
// constant is -1 (the poison sentinel). The IR should instead fold to ub.poison.
// Regression test for https://github.com/llvm/llvm-project/issues/188404
```

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


More information about the Mlir-commits mailing list