[PATCH] D100163: [MSSA] Rename uses in IDF regardless of new def position in basic block.

Alina Sbirlea via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 9 12:33:04 PDT 2021


This revision was automatically updated to reflect the committed changes.
Closed by commit rGf6bff8d15778: [MSSA] Rename uses in IDF regardless of new def position in basic block. (authored by asbirlea).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D100163/new/

https://reviews.llvm.org/D100163

Files:
  llvm/lib/Analysis/MemorySSAUpdater.cpp


Index: llvm/lib/Analysis/MemorySSAUpdater.cpp
===================================================================
--- llvm/lib/Analysis/MemorySSAUpdater.cpp
+++ llvm/lib/Analysis/MemorySSAUpdater.cpp
@@ -363,14 +363,11 @@
     // place, compute IDF and place phis.
     SmallPtrSet<BasicBlock *, 2> DefiningBlocks;
 
-    // If this is the last Def in the block, also compute IDF based on MD, since
-    // this may a new Def added, and we may need additional Phis.
-    auto Iter = MD->getDefsIterator();
-    ++Iter;
-    auto IterEnd = MSSA->getBlockDefs(MD->getBlock())->end();
-    if (Iter == IterEnd)
-      DefiningBlocks.insert(MD->getBlock());
-
+    // If this is the last Def in the block, we may need additional Phis.
+    // Compute IDF in all cases, as renaming needs to be done even when MD is
+    // not the last access, because it can introduce a new access past which a
+    // previous access was optimized; that access needs to be reoptimized.
+    DefiningBlocks.insert(MD->getBlock());
     for (const auto &VH : InsertedPHIs)
       if (const auto *RealPHI = cast_or_null<MemoryPhi>(VH))
         DefiningBlocks.insert(RealPHI->getBlock());


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D100163.336544.patch
Type: text/x-patch
Size: 1166 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210409/ebacfdfc/attachment.bin>


More information about the llvm-commits mailing list