[llvm] r260013 - Only insert into definingblocks once per block

Daniel Berlin via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 6 17:52:16 PST 2016


Author: dannyb
Date: Sat Feb  6 19:52:15 2016
New Revision: 260013

URL: http://llvm.org/viewvc/llvm-project?rev=260013&view=rev
Log:
Only insert into definingblocks once per block

Modified:
    llvm/trunk/lib/Transforms/Utils/MemorySSA.cpp

Modified: llvm/trunk/lib/Transforms/Utils/MemorySSA.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/MemorySSA.cpp?rev=260013&r1=260012&r2=260013&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/MemorySSA.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/MemorySSA.cpp Sat Feb  6 19:52:15 2016
@@ -253,17 +253,20 @@ MemorySSAWalker *MemorySSA::buildMemoryS
   // Go through each block, figure out where defs occur, and chain together all
   // the accesses.
   for (BasicBlock &B : F) {
+    bool InsertIntoDef = false;
     AccessListType *Accesses = nullptr;
     for (Instruction &I : B) {
       MemoryAccess *MA = createNewAccess(&I, true);
       if (!MA)
         continue;
       if (isa<MemoryDef>(MA))
-        DefiningBlocks.insert(&B);
+        InsertIntoDef = true;
       if (!Accesses)
         Accesses = getOrCreateAccessList(&B);
       Accesses->push_back(MA);
     }
+    if (InsertIntoDef)
+      DefiningBlocks.insert(&B);
   }
 
   // Determine where our MemoryPhi's should go




More information about the llvm-commits mailing list