mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-24 22:24:54 +00:00
Fix a obvious logic error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82610 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -826,21 +826,21 @@ void SimpleRegisterCoalescing::RemoveUnnecessaryKills(unsigned Reg,
|
||||
MachineInstrIndex UseIdx =
|
||||
li_->getUseIndex(li_->getInstructionIndex(UseMI));
|
||||
const LiveRange *LR = LI.getLiveRangeContaining(UseIdx);
|
||||
if (!LR || !LR->valno->isKill(li_->getNextSlot(UseIdx))) {
|
||||
if (LR->valno->def != li_->getNextSlot(UseIdx)) {
|
||||
// Interesting problem. After coalescing reg1027's def and kill are both
|
||||
// at the same point: %reg1027,0.000000e+00 = [56,814:0) 0@70-(814)
|
||||
//
|
||||
// bb5:
|
||||
// 60 %reg1027<def> = t2MOVr %reg1027, 14, %reg0, %reg0
|
||||
// 68 %reg1027<def> = t2LDRi12 %reg1027<kill>, 8, 14, %reg0
|
||||
// 76 t2CMPzri %reg1038<kill,undef>, 0, 14, %reg0, %CPSR<imp-def>
|
||||
// 84 %reg1027<def> = t2MOVr %reg1027, 14, %reg0, %reg0
|
||||
// 96 t2Bcc mbb<bb5,0x2030910>, 1, %CPSR<kill>
|
||||
//
|
||||
// Do not remove the kill marker on t2LDRi12.
|
||||
UseMO.setIsKill(false);
|
||||
}
|
||||
if (!LR ||
|
||||
(!LR->valno->isKill(li_->getNextSlot(UseIdx)) &&
|
||||
LR->valno->def != li_->getNextSlot(UseIdx))) {
|
||||
// Interesting problem. After coalescing reg1027's def and kill are both
|
||||
// at the same point: %reg1027,0.000000e+00 = [56,814:0) 0@70-(814)
|
||||
//
|
||||
// bb5:
|
||||
// 60 %reg1027<def> = t2MOVr %reg1027, 14, %reg0, %reg0
|
||||
// 68 %reg1027<def> = t2LDRi12 %reg1027<kill>, 8, 14, %reg0
|
||||
// 76 t2CMPzri %reg1038<kill,undef>, 0, 14, %reg0, %CPSR<imp-def>
|
||||
// 84 %reg1027<def> = t2MOVr %reg1027, 14, %reg0, %reg0
|
||||
// 96 t2Bcc mbb<bb5,0x2030910>, 1, %CPSR<kill>
|
||||
//
|
||||
// Do not remove the kill marker on t2LDRi12.
|
||||
UseMO.setIsKill(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user