[flang-commits] [flang] [flang][cuda] Allow AbstractResult to run in gpu.module (PR #118529)

via flang-commits flang-commits at lists.llvm.org
Tue Dec 3 11:32:33 PST 2024


================
@@ -448,6 +462,14 @@ class AbstractResultOpt
     mlir::TypeSwitch<mlir::Operation *, void>(op)
         .Case<mlir::func::FuncOp, fir::GlobalOp>([&](auto op) {
           runOnSpecificOperation(op, shouldBoxResult, patterns, target);
+        })
+        .Case<mlir::gpu::GPUModuleOp>([&](auto op) {
+          auto gpuMod = mlir::dyn_cast<mlir::gpu::GPUModuleOp>(*op);
+          for (auto funcOp : gpuMod.template getOps<mlir::func::FuncOp>())
+            runOnSpecificOperation(funcOp, shouldBoxResult, patterns, target);
+          for (auto gpuFuncOp : gpuMod.template getOps<mlir::gpu::GPUFuncOp>())
+            runOnSpecificOperation(gpuFuncOp, shouldBoxResult, patterns,
+                                   target);
----------------
jeanPerier wrote:

Is it possible to have globals inside the GPU module?

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


More information about the flang-commits mailing list