[llvm] [SROA] Conservatively do not split the alloca if ptr is laundered (PR #107557)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 6 06:05:15 PDT 2024


================
@@ -81,7 +81,8 @@ bool llvm::isAllocaPromotable(const AllocaInst *AI) {
         return false;
     } else if (const IntrinsicInst *II = dyn_cast<IntrinsicInst>(U)) {
       if (!II->isLifetimeStartOrEnd() && !II->isDroppable() &&
-          II->getIntrinsicID() != Intrinsic::fake_use)
+          II->getIntrinsicID() != Intrinsic::fake_use &&
+          !II->isLaunderOrStripInvariantGroup())
----------------
nikic wrote:

I don't understand how this is supposed to work. I don't think we have logic to handle these in mem2reg? Also wouldn't we have to scan their uses here?

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


More information about the llvm-commits mailing list