[llvm-commits] [llvm] r158162 - /llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp

Andrew Trick atrick at apple.com
Thu Jun 7 12:41:58 PDT 2012


Author: atrick
Date: Thu Jun  7 14:41:58 2012
New Revision: 158162

URL: http://llvm.org/viewvc/llvm-project?rev=158162&view=rev
Log:
ARM getOperandLatency should return -1 for unknown, consistent with API

Modified:
    llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp

Modified: llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp?rev=158162&r1=158161&r2=158162&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp Thu Jun  7 14:41:58 2012
@@ -2574,8 +2574,9 @@
       DefMI->isRegSequence() || DefMI->isImplicitDef()) {
     return 1;
   }
+  // No operand latency. The caller may fall back to getInstrLatency.
   if (!ItinData || ItinData->isEmpty())
-    return DefMI->mayLoad() ? 3 : 1;
+    return -1;
 
   const MCInstrDesc *DefMCID = &DefMI->getDesc();
   const MCInstrDesc *UseMCID = &UseMI->getDesc();
@@ -3057,6 +3058,8 @@
 
   // Hoist VFP / NEON instructions with 4 or higher latency.
   int Latency = getOperandLatency(ItinData, DefMI, DefIdx, UseMI, UseIdx);
+  if (Latency < 0)
+    Latency = getInstrLatency(ItinData, DefMI);
   if (Latency <= 3)
     return false;
   return DDomain == ARMII::DomainVFP || DDomain == ARMII::DomainNEON ||





More information about the llvm-commits mailing list