mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Model Cortex-a9 load to SUB, RSB, ADD, ADC, SBC, RSC, CMN, MVN, or CMP
pipeline forwarding path. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115098 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -527,26 +527,23 @@ void ScheduleDAGInstrs::ComputeOperandLatency(SUnit *Def, SUnit *Use,
|
||||
MachineInstr *DefMI = Def->getInstr();
|
||||
int DefIdx = DefMI->findRegisterDefOperandIdx(Reg);
|
||||
if (DefIdx != -1) {
|
||||
int DefCycle = InstrItins->getOperandCycle(DefMI->getDesc().getSchedClass(),
|
||||
DefIdx);
|
||||
if (DefCycle >= 0) {
|
||||
MachineInstr *UseMI = Use->getInstr();
|
||||
const unsigned UseClass = UseMI->getDesc().getSchedClass();
|
||||
unsigned DefClass = DefMI->getDesc().getSchedClass();
|
||||
MachineInstr *UseMI = Use->getInstr();
|
||||
unsigned UseClass = UseMI->getDesc().getSchedClass();
|
||||
|
||||
// For all uses of the register, calculate the maxmimum latency
|
||||
int Latency = -1;
|
||||
for (unsigned i = 0, e = UseMI->getNumOperands(); i != e; ++i) {
|
||||
const MachineOperand &MO = UseMI->getOperand(i);
|
||||
if (!MO.isReg() || !MO.isUse())
|
||||
continue;
|
||||
unsigned MOReg = MO.getReg();
|
||||
if (MOReg != Reg)
|
||||
continue;
|
||||
// For all uses of the register, calculate the maxmimum latency
|
||||
int Latency = -1;
|
||||
for (unsigned i = 0, e = UseMI->getNumOperands(); i != e; ++i) {
|
||||
const MachineOperand &MO = UseMI->getOperand(i);
|
||||
if (!MO.isReg() || !MO.isUse())
|
||||
continue;
|
||||
unsigned MOReg = MO.getReg();
|
||||
if (MOReg != Reg)
|
||||
continue;
|
||||
|
||||
int UseCycle = InstrItins->getOperandCycle(UseClass, i);
|
||||
if (UseCycle >= 0)
|
||||
Latency = std::max(Latency, DefCycle - UseCycle + 1);
|
||||
}
|
||||
int UseCycle = InstrItins->getOperandLatency(DefClass, DefIdx,
|
||||
UseClass, i);
|
||||
Latency = std::max(Latency, UseCycle);
|
||||
|
||||
// If we found a latency, then replace the existing dependence latency.
|
||||
if (Latency >= 0)
|
||||
|
Reference in New Issue
Block a user