aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2012-06-07 19:41:58 +0000
committerAndrew Trick <atrick@apple.com>2012-06-07 19:41:58 +0000
commitf377071bf8393d35797107c753da3e84aea94ebe (patch)
treeeade7a9b86d24ac8fad26b498cf3ced4f89dc3d0
parented7a51e69209af87f3749d5f95740f69a1dc7711 (diff)
ARM getOperandLatency should return -1 for unknown, consistent with API
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158162 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/ARM/ARMBaseInstrInfo.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Target/ARM/ARMBaseInstrInfo.cpp b/lib/Target/ARM/ARMBaseInstrInfo.cpp
index f3462d078b..c85a71a5d6 100644
--- a/lib/Target/ARM/ARMBaseInstrInfo.cpp
+++ b/lib/Target/ARM/ARMBaseInstrInfo.cpp
@@ -2574,8 +2574,9 @@ ARMBaseInstrInfo::getOperandLatency(const InstrItineraryData *ItinData,
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 @@ hasHighOperandLatency(const InstrItineraryData *ItinData,
// 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 ||