This makes it more robust when expanding code in other function than
func.func, like spv.func for example.
Fixes #60072
if (funcOp)
return cast<LLVMFuncOp>(*funcOp);
- mlir::OpBuilder b(op->getParentOfType<LLVMFuncOp>());
+ mlir::OpBuilder b(op->getParentOfType<FunctionOpInterface>());
return b.create<LLVMFuncOp>(op->getLoc(), funcName, funcType);
}
gpu.return
}
}
+
+// ----
+
+gpu.module @module {
+// CHECK-LABEL: @spirv_exp
+// CHECK: llvm.call @__ocml_exp_f32
+ spirv.func @spirv_exp(%arg0: vector<4xf32>) -> vector<4xf32> "None" {
+ %0 = math.exp %arg0 : vector<4xf32>
+ spirv.ReturnValue %0 : vector<4xf32>
+ }
+}
+