[llvm-commits] CVS: llvm/lib/Transforms/IPO/GlobalOpt.cpp

Chris Lattner lattner at cs.uiuc.edu
Wed Oct 6 23:01:38 PDT 2004



Changes in directory llvm/lib/Transforms/IPO:

GlobalOpt.cpp updated: 1.10 -> 1.11
---
Log message:

Fix a bug in the safety analysis routine


---
Diffs of the changes:  (+3 -3)

Index: llvm/lib/Transforms/IPO/GlobalOpt.cpp
diff -u llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.10 llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.11
--- llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.10	Wed Oct  6 23:16:33 2004
+++ llvm/lib/Transforms/IPO/GlobalOpt.cpp	Thu Oct  7 01:01:25 2004
@@ -69,6 +69,9 @@
       if (isa<LoadInst>(I)) {
         GS.isLoaded = true;
       } else if (StoreInst *SI = dyn_cast<StoreInst>(I)) {
+        // Don't allow a store OF the address, only stores TO the address.
+        if (SI->getOperand(0) == V) return true;
+
         // If this store is just storing the initializer into a global (i.e. not
         // changing the value), ignore it.  For now we just handle direct
         // stores, no stores to fields of aggregates.
@@ -239,9 +242,6 @@
           
           ++NumMarked;
           Changed = true;
-        } else if (!GS.isNotSuitableForSRA &&
-                   !GV->getInitializer()->getType()->isFirstClassType()) {
-          //std::cerr << "COULD SRA: " << *GV;
         }
       }
     }






More information about the llvm-commits mailing list