mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-22 23:24:59 +00:00
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
This commit is contained in:
@@ -103,7 +103,10 @@ bool IPCP::processFunction(Function &F) {
|
|||||||
// Do we have a constant argument!?
|
// Do we have a constant argument!?
|
||||||
if (!ArgumentConstants[i].second) {
|
if (!ArgumentConstants[i].second) {
|
||||||
assert(ArgumentConstants[i].first && "Unknown constant value!");
|
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;
|
++NumArgumentsProped;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
Reference in New Issue
Block a user