mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-22 10:36:10 +00:00
Fix a major bug in operand latency computation. The use index must be adjusted
by the number of defs first for it to match the instruction itinerary. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117518 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e49406fd63
commit
7c88cdcc3b
@ -454,6 +454,9 @@ void ScheduleDAGSDNodes::ComputeOperandLatency(SDNode *Def, SDNode *Use,
|
||||
return;
|
||||
|
||||
unsigned DefIdx = Use->getOperand(OpIdx).getResNo();
|
||||
if (Use->isMachineOpcode())
|
||||
// Adjust the use operand index by num of defs.
|
||||
OpIdx += TII->get(Use->getMachineOpcode()).getNumDefs();
|
||||
int Latency = TII->getOperandLatency(InstrItins, Def, DefIdx, Use, OpIdx);
|
||||
if (Latency >= 0)
|
||||
dep.setLatency(Latency);
|
||||
|
Loading…
x
Reference in New Issue
Block a user