[Mlir-commits] [mlir] [mlir][gpu] Loose the condition to convert scf.parallel to gpu.launch (PR #164978)
    Georgios Pinitas 
    llvmlistbot at llvm.org
       
    Tue Oct 28 05:20:22 PDT 2025
    
    
  
================
@@ -682,6 +716,18 @@ ParallelToGpuLaunchLowering::matchAndRewrite(ParallelOp parallelOp,
       Operation *clone = rewriter.clone(*op, cloningMap);
       cloningMap.map(op->getResults(), clone->getResults());
       // Check for side effects.
+      if (!isMemoryEffectFree(clone)) {
+        // Record the buffer accessed by the operations with write effects.
+        if (auto memEffectInterface =
+                dyn_cast<MemoryEffectOpInterface>(clone)) {
+          SmallVector<MemoryEffects::EffectInstance> effects;
+          memEffectInterface.getEffects(effects);
+          for (const auto &effect : effects) {
+            if (isa<MemoryEffects::Write>(effect.getEffect()))
+              writtenBuffer.insert(effect.getValue());
----------------
GeorgeARM wrote:
can `effect.getValue()` return null?
https://github.com/llvm/llvm-project/pull/164978
    
    
More information about the Mlir-commits
mailing list