mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-25 00:24:26 +00:00
Lett users of sparse propagation do their own thing with phi nodes if they want
to. This can be combined with LCSSA or SSI form to store more information on a PHINode than can be computed by looking at its incoming values. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82317 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -73,6 +73,12 @@ public:
|
|||||||
return getOverdefinedVal(); // always safe
|
return getOverdefinedVal(); // always safe
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// IsSpecialCasedPHI - Given a PHI node, determine whether this PHI node is
|
||||||
|
/// one that the we want to handle through ComputeInstructionState.
|
||||||
|
virtual bool IsSpecialCasedPHI(PHINode *PN) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/// GetConstant - If the specified lattice value is representable as an LLVM
|
/// GetConstant - If the specified lattice value is representable as an LLVM
|
||||||
/// constant value, return it. Otherwise return null. The returned value
|
/// constant value, return it. Otherwise return null. The returned value
|
||||||
/// must be in the same LLVM type as Val.
|
/// must be in the same LLVM type as Val.
|
||||||
|
@ -223,6 +223,13 @@ void SparseSolver::visitTerminatorInst(TerminatorInst &TI) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void SparseSolver::visitPHINode(PHINode &PN) {
|
void SparseSolver::visitPHINode(PHINode &PN) {
|
||||||
|
if (LatticeFunc->IsSpecialCasedPHI(&PN)) {
|
||||||
|
LatticeVal IV = LatticeFunc->ComputeInstructionState(PN, *this);
|
||||||
|
if (IV != LatticeFunc->getUntrackedVal())
|
||||||
|
UpdateState(PN, IV);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
LatticeVal PNIV = getOrInitValueState(&PN);
|
LatticeVal PNIV = getOrInitValueState(&PN);
|
||||||
LatticeVal Overdefined = LatticeFunc->getOverdefinedVal();
|
LatticeVal Overdefined = LatticeFunc->getOverdefinedVal();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user