[Mlir-commits] [mlir] [mlir][vector] Fix crash in vector.from_elements folding with poison values (PR #158528)

Matthias Springer llvmlistbot at llvm.org
Thu Sep 18 00:13:46 PDT 2025


================
@@ -3375,6 +3375,42 @@ func.func @negative_from_elements_to_constant() -> vector<1x!llvm.ptr> {
   return %b : vector<1x!llvm.ptr>
 }
 
+// -----
+
+// CHECK-LABEL: @negative_from_elements_poison
+//       CHECK:   %[[VAL:.*]] = ub.poison : vector<2xf32>
+//       CHECK:   return %[[VAL]] : vector<2xf32>
+func.func @negative_from_elements_poison_f32() -> vector<2xf32> {
----------------
matthias-springer wrote:

Folders always run before any pattern application is attempted, so this test looks good to me. (We are exercising the code path that used to crash.)


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


More information about the Mlir-commits mailing list