mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-09 13:33:17 +00:00
Only cound if we actually made a change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18800 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
284d1b8827
commit
2ffa47b6bf
@ -180,9 +180,12 @@ bool IPCP::PropagateConstantReturn(Function &F) {
|
||||
if (ReplacedAllUsers && F.hasInternalLinkage() && !isa<UndefValue>(RetVal)) {
|
||||
Value *RV = UndefValue::get(RetVal->getType());
|
||||
for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB)
|
||||
if (ReturnInst *RI = dyn_cast<ReturnInst>(BB->getTerminator()))
|
||||
RI->setOperand(0, RV);
|
||||
MadeChange = true;
|
||||
if (ReturnInst *RI = dyn_cast<ReturnInst>(BB->getTerminator())) {
|
||||
if (RI->getOperand(0) != RV) {
|
||||
RI->setOperand(0, RV);
|
||||
MadeChange = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (MadeChange) ++NumReturnValProped;
|
||||
|
Loading…
x
Reference in New Issue
Block a user