Latency between CPSR def and branch is zero.

llvm-svn: 117192
This commit is contained in:
Evan Cheng 2010-10-23 02:04:38 +00:00
parent 8a09620dc2
commit ad79526471
1 changed files with 6 additions and 0 deletions

View File

@ -1892,7 +1892,13 @@ ARMBaseInstrInfo::getOperandLatency(const InstrItineraryData *ItinData,
if (!ItinData || ItinData->isEmpty())
return DefTID.mayLoad() ? 3 : 1;
const TargetInstrDesc &UseTID = UseMI->getDesc();
const MachineOperand &DefMO = DefMI->getOperand(DefIdx);
if (DefMO.getReg() == ARM::CPSR && UseTID.isBranch())
// CPSR set and branch can be paired in the same cycle.
return 0;
unsigned DefAlign = DefMI->hasOneMemOperand()
? (*DefMI->memoperands_begin())->getAlignment() : 0;
unsigned UseAlign = UseMI->hasOneMemOperand()