[Mlir-commits] [mlir] [mlir][SPIR-V] Add SPIRVToLLVM conversions for GL.FMix and CL.mix (PR #206935)
Arseniy Obolenskiy
llvmlistbot at llvm.org
Sun Jul 5 21:56:22 PDT 2026
================
@@ -1584,6 +1584,31 @@ class FractPattern : public SPIRVToLLVMConversion<spirv::GLFractOp> {
}
};
+/// Converts `spirv.GL.FMix`/`spirv.CL.mix` to `fma(a, y - x, x)`, the linear
+/// blend `x * (1 - a) + y * a`. Operands are taken positionally because the GL
+/// and CL ops name their third operand differently (`a` vs. `z`).
+template <typename SPIRVOp>
+class MixPattern : public SPIRVToLLVMConversion<SPIRVOp> {
+public:
+ using SPIRVToLLVMConversion<SPIRVOp>::SPIRVToLLVMConversion;
+
+ LogicalResult
+ matchAndRewrite(SPIRVOp op, typename SPIRVOp::Adaptor adaptor,
+ ConversionPatternRewriter &rewriter) const override {
+ auto dstType = this->getTypeConverter()->convertType(op.getType());
----------------
aobolensk wrote:
Done
https://github.com/llvm/llvm-project/pull/206935
More information about the Mlir-commits
mailing list