Skip to content

Commit 12b78db

Browse files
committed
We might as well strip off any CPRs before propagation
llvm-svn: 9437
1 parent bf9584b commit 12b78db

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

llvm/lib/Transforms/IPO/IPConstantPropagation.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,10 @@ bool IPCP::processFunction(Function &F) {
103103
// Do we have a constant argument!?
104104
if (!ArgumentConstants[i].second) {
105105
assert(ArgumentConstants[i].first && "Unknown constant value!");
106-
AI->replaceAllUsesWith(ArgumentConstants[i].first);
106+
Value *V = ArgumentConstants[i].first;
107+
if (ConstantPointerRef *CPR = dyn_cast<ConstantPointerRef>(V))
108+
V = CPR->getValue();
109+
AI->replaceAllUsesWith(V);
107110
++NumArgumentsProped;
108111
}
109112
return true;

0 commit comments

Comments
 (0)