mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-15 07:34:33 +00:00
Fix the conditions under which SCCP should examine insertvalue
instructions. Thanks to Matthijs Kooijman for pointing this out! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52542 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
be20a88f53
commit
dfaceb49fc
@ -750,7 +750,7 @@ void SCCPSolver::visitInsertValueInst(InsertValueInst &IVI) {
|
|||||||
Value *Val = IVI.getOperand(1);
|
Value *Val = IVI.getOperand(1);
|
||||||
|
|
||||||
// If the operand to the getresult is an undef, the result is undef.
|
// If the operand to the getresult is an undef, the result is undef.
|
||||||
if (isa<UndefValue>(Aggr))
|
if (isa<UndefValue>(Aggr) && isa<UndefValue>(Val))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Currently only handle single-index insertvalues.
|
// Currently only handle single-index insertvalues.
|
||||||
@ -759,6 +759,23 @@ void SCCPSolver::visitInsertValueInst(InsertValueInst &IVI) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Currently only handle insertvalue instructions that are in a single-use
|
||||||
|
// chain that builds up a return value.
|
||||||
|
for (const InsertValueInst *TmpIVI = &IVI; ; ) {
|
||||||
|
if (!TmpIVI->hasOneUse()) {
|
||||||
|
markOverdefined(&IVI);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const Value *V = *TmpIVI->use_begin();
|
||||||
|
if (isa<ReturnInst>(V))
|
||||||
|
break;
|
||||||
|
TmpIVI = dyn_cast<InsertValueInst>(V);
|
||||||
|
if (!TmpIVI) {
|
||||||
|
markOverdefined(&IVI);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// See if we are tracking the result of the callee.
|
// See if we are tracking the result of the callee.
|
||||||
Function *F = IVI.getParent()->getParent();
|
Function *F = IVI.getParent()->getParent();
|
||||||
std::map<std::pair<Function*, unsigned>, LatticeVal>::iterator
|
std::map<std::pair<Function*, unsigned>, LatticeVal>::iterator
|
||||||
|
Loading…
x
Reference in New Issue
Block a user