[Mlir-commits] [mlir] [mlir][SPIR-V] Add SPIRVToLLVM conversion for VectorTimesScalar (PR #206949)
Igor Wodiany
llvmlistbot at llvm.org
Tue Jul 28 06:51:19 PDT 2026
================
@@ -919,6 +919,31 @@ class InverseSqrtPattern
}
};
+/// Converts `spirv.VectorTimesScalar` to a broadcast of the scalar followed by
+/// an `llvm.fmul`.
+class VectorTimesScalarPattern
+ : public SPIRVToLLVMConversion<spirv::VectorTimesScalarOp> {
+public:
+ using SPIRVToLLVMConversion<
+ spirv::VectorTimesScalarOp>::SPIRVToLLVMConversion;
+
+ LogicalResult
+ matchAndRewrite(spirv::VectorTimesScalarOp op, OpAdaptor adaptor,
+ ConversionPatternRewriter &rewriter) const override {
----------------
IgWod wrote:
```suggestion
Type srcType = op.getType();
Type dstType = getTypeConverter()->convertType(srcType);
```
https://github.com/llvm/llvm-project/pull/206949
More information about the Mlir-commits
mailing list