From: Chris Lattner Date: Thu, 23 Oct 2003 18:49:23 +0000 (+0000) Subject: We might as well strip off any CPRs before propagation X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=2e56dd82b3b3ab9dde8cc55c06df78cec4dbd3b7;p=oota-llvm.git We might as well strip off any CPRs before propagation git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9437 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/IPO/IPConstantPropagation.cpp b/lib/Transforms/IPO/IPConstantPropagation.cpp index dc8698e1622..bb21f11ffc3 100644 --- a/lib/Transforms/IPO/IPConstantPropagation.cpp +++ b/lib/Transforms/IPO/IPConstantPropagation.cpp @@ -103,7 +103,10 @@ bool IPCP::processFunction(Function &F) { // Do we have a constant argument!? if (!ArgumentConstants[i].second) { assert(ArgumentConstants[i].first && "Unknown constant value!"); - AI->replaceAllUsesWith(ArgumentConstants[i].first); + Value *V = ArgumentConstants[i].first; + if (ConstantPointerRef *CPR = dyn_cast(V)) + V = CPR->getValue(); + AI->replaceAllUsesWith(V); ++NumArgumentsProped; } return true;