forked from OSchip/llvm-project
Take another stab at getting isLiveIn() and isLiveOut() right.
llvm-svn: 43869
This commit is contained in:
parent
4ac4ec215f
commit
bfbc12973d
|
@ -225,9 +225,8 @@ 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)
|
||||
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 (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;
|
||||
|
||||
if (V.DefInst->getParent() == MBB)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue