[Mlir-commits] [mlir] [mlir][spirv] Support poison index when converting vector.insert/extract (PR #125560)

Andrea Faulds llvmlistbot at llvm.org
Tue Feb 4 10:53:40 PST 2025


================
@@ -154,14 +181,26 @@ struct VectorExtractOpConvert final
     }
 
     if (std::optional<int64_t> id =
-            getConstantIntValue(extractOp.getMixedPosition()[0]))
-      rewriter.replaceOpWithNewOp<spirv::CompositeExtractOp>(
-          extractOp, dstType, adaptor.getVector(),
-          rewriter.getI32ArrayAttr(id.value()));
-    else
+            getConstantIntValue(extractOp.getMixedPosition()[0])) {
+      // TODO: ExtractOp::fold() already can fold a static poison index to
+      //       ub.poison; remove this once ub.poison can be converted to SPIR-V.
----------------
andfau-amd wrote:

(I intend to tackle ub.poison to SPIR-V conversion myself soon, and I'll clean this up in that commit.)

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


More information about the Mlir-commits mailing list