[llvm-commits] [llvm] r64926 - /llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp

Duncan Sands baldrick at free.fr
Wed Feb 18 09:55:38 PST 2009


Author: baldrick
Date: Wed Feb 18 11:55:38 2009
New Revision: 64926

URL: http://llvm.org/viewvc/llvm-project?rev=64926&view=rev
Log:
In theory the aliasee may have dead constant users
here.  Since we only do the transform if there is
one use, strip off any such users in the hope of
making the transform fire more often.

Modified:
    llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp

Modified: llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp?rev=64926&r1=64925&r2=64926&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp Wed Feb 18 11:55:38 2009
@@ -2383,6 +2383,7 @@
 
     Constant *Aliasee = J->getAliasee();
     GlobalValue *Target = cast<GlobalValue>(Aliasee->stripPointerCasts());
+    Target->removeDeadConstantUsers();
     bool hasOneUse = Target->hasOneUse() && Aliasee->hasOneUse();
 
     // Make all users of the alias use the aliasee instead.





More information about the llvm-commits mailing list