forked from OSchip/llvm-project
We might as well strip off any CPRs before propagation
llvm-svn: 9437
This commit is contained in:
parent
bf9584b041
commit
12b78db685
|
@ -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<ConstantPointerRef>(V))
|
||||
V = CPR->getValue();
|
||||
AI->replaceAllUsesWith(V);
|
||||
++NumArgumentsProped;
|
||||
}
|
||||
return true;
|
||||
|
|
Loading…
Reference in New Issue