From: Duncan Sands Date: Wed, 18 Feb 2009 17:55:38 +0000 (+0000) Subject: In theory the aliasee may have dead constant users X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=95c5d0fb0a4e1ec88edae43c2db464e0cc63c76e;p=oota-llvm.git 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64926 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/IPO/GlobalOpt.cpp b/lib/Transforms/IPO/GlobalOpt.cpp index 0ac1e65891b..0a35fa93e43 100644 --- a/lib/Transforms/IPO/GlobalOpt.cpp +++ b/lib/Transforms/IPO/GlobalOpt.cpp @@ -2383,6 +2383,7 @@ bool GlobalOpt::ResolveAliases(Module &M) { Constant *Aliasee = J->getAliasee(); GlobalValue *Target = cast(Aliasee->stripPointerCasts()); + Target->removeDeadConstantUsers(); bool hasOneUse = Target->hasOneUse() && Aliasee->hasOneUse(); // Make all users of the alias use the aliasee instead.