mirror of
https://github.com/RPCS3/llvm.git
synced 2026-07-21 03:05:26 -04:00
CodeGen: Make computeRegisterLiveness consider successors
If the end of the block is reached during the scan, check the live ins of the successors. This was already done in the other direction if the block entry was reached. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341026 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1439,6 +1439,20 @@ MachineBasicBlock::computeRegisterLiveness(const TargetRegisterInfo *TRI,
|
||||
}
|
||||
}
|
||||
|
||||
// If we reached the end, it is safe to clobber Reg at the end of a block of
|
||||
// no successor has it live in.
|
||||
if (I == end()) {
|
||||
for (MachineBasicBlock *S : successors()) {
|
||||
for (MCSubRegIterator SubReg(Reg, TRI, /*IncludeSelf*/true);
|
||||
SubReg.isValid(); ++SubReg) {
|
||||
if (S->isLiveIn(*SubReg))
|
||||
return LQR_Live;
|
||||
}
|
||||
}
|
||||
|
||||
return LQR_Dead;
|
||||
}
|
||||
|
||||
// At this point we have no idea of the liveness of the register.
|
||||
return LQR_Unknown;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user