summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2010-10-29 18:09:28 +0000
committerEvan Cheng <evan.cheng@apple.com>2010-10-29 18:09:28 +0000
commit6c1414f9c2084e47ee3d4fcae30d03de72f9ee3f (patch)
treef53d79edd7deeaf54d476c206f62c58abe3b0390 /llvm/lib/Target
parent0c4c5ca6e1d141e60cafeb136b824293cbd87b4a (diff)
downloadbcm5719-llvm-6c1414f9c2084e47ee3d4fcae30d03de72f9ee3f.tar.gz
bcm5719-llvm-6c1414f9c2084e47ee3d4fcae30d03de72f9ee3f.zip
Avoiding overly aggressive latency scheduling. If the two nodes share an
operand and one of them has a single use that is a live out copy, favor the one that is live out. Otherwise it will be difficult to eliminate the copy if the instruction is a loop induction variable update. e.g. BB: sub r1, r3, #1 str r0, [r2, r3] mov r3, r1 cmp bne BB => BB: str r0, [r2, r3] sub r3, r3, #1 cmp bne BB This fixed the recent 256.bzip2 regression. llvm-svn: 117675
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp b/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
index 51db6775817..c23bc93925b 100644
--- a/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
+++ b/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
@@ -1967,8 +1967,13 @@ ARMBaseInstrInfo::getOperandLatency(const InstrItineraryData *ItinData,
if (!ItinData || ItinData->isEmpty())
return DefTID.mayLoad() ? 3 : 1;
- if (!UseNode->isMachineOpcode())
- return ItinData->getOperandCycle(DefTID.getSchedClass(), DefIdx);
+ if (!UseNode->isMachineOpcode()) {
+ int Latency = ItinData->getOperandCycle(DefTID.getSchedClass(), DefIdx);
+ if (Subtarget.isCortexA9())
+ return Latency <= 2 ? 1 : Latency - 1;
+ else
+ return Latency <= 3 ? 1 : Latency - 2;
+ }
const TargetInstrDesc &UseTID = get(UseNode->getMachineOpcode());
const MachineSDNode *DefMN = dyn_cast<MachineSDNode>(DefNode);
OpenPOWER on IntegriCloud