mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-25 16:30:05 +00:00
Take another stab at getting isLiveIn() and isLiveOut() right.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43869 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
401f78f8a9
commit
14b3fb7805
@ -225,10 +225,9 @@ bool isLiveIn(LiveVariables::VarInfo& V, MachineBasicBlock* MBB) {
|
||||
if (V.AliveBlocks.test(MBB->getNumber()))
|
||||
return true;
|
||||
|
||||
for (std::vector<MachineInstr*>::iterator I = V.Kills.begin(),
|
||||
E = V.Kills.end(); I != E; ++I)
|
||||
if ((*I)->getParent() == MBB)
|
||||
return true;
|
||||
if (V.DefInst->getParent() != MBB &&
|
||||
V.UsedBlocks.test(MBB->getNumber()))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
@ -236,11 +235,15 @@ bool isLiveIn(LiveVariables::VarInfo& V, MachineBasicBlock* MBB) {
|
||||
/// isLiveOut - help method that determines, from a VarInfo, if a register is
|
||||
/// live out of a block.
|
||||
bool isLiveOut(LiveVariables::VarInfo& V, MachineBasicBlock* MBB) {
|
||||
if (V.AliveBlocks.test(MBB->getNumber()))
|
||||
return true;
|
||||
|
||||
if (V.DefInst->getParent() == MBB)
|
||||
if (MBB == V.DefInst->getParent() ||
|
||||
V.UsedBlocks.test(MBB->getNumber())) {
|
||||
for (std::vector<MachineInstr*>::iterator I = V.Kills.begin(),
|
||||
E = V.Kills.end(); I != E; ++I)
|
||||
if ((*I)->getParent() == MBB)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user