mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-07 14:33:15 +00:00
misched: cleanup reaching def computation
Ignore undef uses completely. Use a more explicit SlotIndex API. Add more explicit comments. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151233 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
5fb468a6b3
commit
63d578b5aa
@ -408,10 +408,12 @@ void ScheduleDAGInstrs::addVRegUseDeps(SUnit *SU, unsigned OperIdx) {
|
|||||||
|
|
||||||
// Lookup this operand's reaching definition.
|
// Lookup this operand's reaching definition.
|
||||||
assert(LIS && "vreg dependencies requires LiveIntervals");
|
assert(LIS && "vreg dependencies requires LiveIntervals");
|
||||||
SlotIndex UseIdx = LIS->getSlotIndexes()->getInstructionIndex(MI);
|
SlotIndex UseIdx = LIS->getInstructionIndex(MI).getRegSlot();
|
||||||
LiveInterval *LI = &LIS->getInterval(Reg);
|
LiveInterval *LI = &LIS->getInterval(Reg);
|
||||||
VNInfo *VNI = LI->getVNInfoAt(UseIdx);
|
VNInfo *VNI = LI->getVNInfoBefore(UseIdx);
|
||||||
|
// VNI will be valid because MachineOperand::readsReg() is checked by caller.
|
||||||
MachineInstr *Def = LIS->getInstructionFromIndex(VNI->def);
|
MachineInstr *Def = LIS->getInstructionFromIndex(VNI->def);
|
||||||
|
// Phis and other noninstructions (after coalescing) have a NULL Def.
|
||||||
if (Def) {
|
if (Def) {
|
||||||
SUnit *DefSU = getSUnit(Def);
|
SUnit *DefSU = getSUnit(Def);
|
||||||
if (DefSU) {
|
if (DefSU) {
|
||||||
@ -540,7 +542,7 @@ void ScheduleDAGInstrs::BuildSchedGraph(AliasAnalysis *AA) {
|
|||||||
assert(!IsPostRA && "Virtual register encountered!");
|
assert(!IsPostRA && "Virtual register encountered!");
|
||||||
if (MO.isDef())
|
if (MO.isDef())
|
||||||
addVRegDefDeps(SU, j);
|
addVRegDefDeps(SU, j);
|
||||||
else
|
else if (MO.readsReg()) // ignore undef operands
|
||||||
addVRegUseDeps(SU, j);
|
addVRegUseDeps(SU, j);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user