From f377071bf8393d35797107c753da3e84aea94ebe Mon Sep 17 00:00:00 2001 From: Andrew Trick Date: Thu, 7 Jun 2012 19:41:58 +0000 Subject: [PATCH] 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 --- lib/Target/ARM/ARMBaseInstrInfo.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/Target/ARM/ARMBaseInstrInfo.cpp b/lib/Target/ARM/ARMBaseInstrInfo.cpp index f3462d078bb..c85a71a5d61 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 ||