Fix ARMBaseInstrInfo::getInstrLatency for calls.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Fri, 17 Feb 2012 19:07:59 +0000 (19:07 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Fri, 17 Feb 2012 19:07:59 +0000 (19:07 +0000)
Calls always clobber CPSR.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150831 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/ARMBaseInstrInfo.cpp

index 2d7df09411ddfc26c451e59e571474ef00a246b2..166b248f9139121918d695608798b79dc51ed2dc 100644 (file)
@@ -2849,7 +2849,7 @@ int ARMBaseInstrInfo::getInstrLatency(const InstrItineraryData *ItinData,
   const MCInstrDesc &MCID = MI->getDesc();
   unsigned Class = MCID.getSchedClass();
   unsigned UOps = ItinData->Itineraries[Class].NumMicroOps;
-  if (PredCost && MCID.hasImplicitDefOfPhysReg(ARM::CPSR))
+  if (PredCost && (MCID.isCall() || MCID.hasImplicitDefOfPhysReg(ARM::CPSR)))
     // When predicated, CPSR is an additional source operand for CPSR updating
     // instructions, this apparently increases their latencies.
     *PredCost = 1;