[Mlir-commits] [mlir] [mlir] Let GPU ID bounds work on any FunctionOpInterfaces (PR #95166)

Jakub Kuderski llvmlistbot at llvm.org
Wed Jun 12 10:20:03 PDT 2024


================
@@ -57,11 +57,7 @@ struct GPUIndexIntrinsicOpLowering : public ConvertOpToLLVMPattern<Op> {
       break;
     }
 
-    Operation *function;
-    if (auto gpuFunc = op->template getParentOfType<gpu::GPUFuncOp>())
-      function = gpuFunc;
-    if (auto llvmFunc = op->template getParentOfType<LLVM::LLVMFuncOp>())
-      function = llvmFunc;
+    Operation *function = op->template getParentOfType<FunctionOpInterface>();
----------------
kuhar wrote:

Generalizing this seems fine to me until we have a non-discardable attribute on `gpu.func`

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


More information about the Mlir-commits mailing list