[Mlir-commits] [mlir] [mlir][Math][LLVMSPV] Add Math to LLVM-SPV conversion pass (PR #198370)

Akhil Goel llvmlistbot at llvm.org
Tue Jun 9 09:26:05 PDT 2026


================
@@ -119,6 +123,76 @@ struct ConvertNativeFuncPattern final : public OpConversionPattern<Op> {
   const StringRef nativeFunc;
 };
 
+template <typename OpTy>
+static void populateOCLExtSetOpPatterns(const LLVMTypeConverter &converter,
+                                        RewritePatternSet &patterns,
+                                        PatternBenefit benefit,
+                                        StringRef opName) {
+  std::string prefix = "__spirv_ocl_";
+  std::string mangledName = "_Z" +
+                            std::to_string(prefix.size() + opName.size()) +
+                            prefix + opName.str();
+
----------------
akhilgoe wrote:

Before converting to calls, I run `ScalarizeVectorOpLowering`, so all inputs should be scalars.

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


More information about the Mlir-commits mailing list