[Mlir-commits] [mlir] [MLIR] Add single definition multiple regions for mem2reg (PR #89107)

Christian Ulmann llvmlistbot at llvm.org
Thu Apr 18 08:06:44 PDT 2024


================
@@ -297,14 +313,52 @@ LogicalResult MemorySlotPromotionAnalyzer::computeBlockingUses(
     }
   }
 
-  // Because this pass currently only supports analysing the parent region of
-  // the slot pointer, if a promotable memory op that needs promotion is outside
-  // of this region, promotion must fail because it will be impossible to
-  // provide a valid `reachingDef` for it.
-  for (auto &[toPromote, _] : userToBlockingUses)
+  // The define uses web only have one definition, It is the potential case.
+  totalStores != 1 ? singleDefining.setPointer(nullptr) : (void)0;
----------------
Dinistro wrote:

What's so bad about using an normal `if` here?

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


More information about the Mlir-commits mailing list