[Mlir-commits] [mlir] 6818ad4 - [mlir][SPIR-V] Convert math.erfc to OpenCL erfc (#201907)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Mon Jun 8 01:41:10 PDT 2026
Author: Arseniy Obolenskiy
Date: 2026-06-08T10:41:05+02:00
New Revision: 6818ad463b5af19ecfb878a71d829c2f0e4f7f19
URL: https://github.com/llvm/llvm-project/commit/6818ad463b5af19ecfb878a71d829c2f0e4f7f19
DIFF: https://github.com/llvm/llvm-project/commit/6818ad463b5af19ecfb878a71d829c2f0e4f7f19.diff
LOG: [mlir][SPIR-V] Convert math.erfc to OpenCL erfc (#201907)
Added:
Modified:
mlir/lib/Conversion/MathToSPIRV/MathToSPIRV.cpp
mlir/test/Conversion/MathToSPIRV/math-to-opencl-spirv.mlir
Removed:
################################################################################
diff --git a/mlir/lib/Conversion/MathToSPIRV/MathToSPIRV.cpp b/mlir/lib/Conversion/MathToSPIRV/MathToSPIRV.cpp
index da9ce2b747fb4..987fe7841033d 100644
--- a/mlir/lib/Conversion/MathToSPIRV/MathToSPIRV.cpp
+++ b/mlir/lib/Conversion/MathToSPIRV/MathToSPIRV.cpp
@@ -656,6 +656,7 @@ void populateMathToSPIRVPatterns(const SPIRVTypeConverter &typeConverter,
CheckedElementwiseOpPattern<math::CeilOp, spirv::CLCeilOp>,
CheckedElementwiseOpPattern<math::CosOp, spirv::CLCosOp>,
CheckedElementwiseOpPattern<math::ErfOp, spirv::CLErfOp>,
+ CheckedElementwiseOpPattern<math::ErfcOp, spirv::CLErfcOp>,
CheckedElementwiseOpPattern<math::ExpOp, spirv::CLExpOp>,
CheckedElementwiseOpPattern<math::Exp2Op, spirv::CLExp2Op>,
CheckedElementwiseOpPattern<math::FloorOp, spirv::CLFloorOp>,
diff --git a/mlir/test/Conversion/MathToSPIRV/math-to-opencl-spirv.mlir b/mlir/test/Conversion/MathToSPIRV/math-to-opencl-spirv.mlir
index d972d4f6dba9e..0be69ba6cabe4 100644
--- a/mlir/test/Conversion/MathToSPIRV/math-to-opencl-spirv.mlir
+++ b/mlir/test/Conversion/MathToSPIRV/math-to-opencl-spirv.mlir
@@ -44,6 +44,8 @@ func.func @float32_unary_scalar(%arg0: f32) {
%15 = math.floor %arg0 : f32
// CHECK: spirv.CL.erf %{{.*}}: f32
%16 = math.erf %arg0 : f32
+ // CHECK: spirv.CL.erfc %{{.*}}: f32
+ %erfc = math.erfc %arg0 : f32
// CHECK: spirv.CL.round %{{.*}}: f32
%17 = math.round %arg0 : f32
// CHECK: spirv.CL.tan %{{.*}}: f32
More information about the Mlir-commits
mailing list