diff options
| author | Evan Cheng <evan.cheng@apple.com> | 2010-05-28 23:25:23 +0000 |
|---|---|---|
| committer | Evan Cheng <evan.cheng@apple.com> | 2010-05-28 23:25:23 +0000 |
| commit | bf91499f1a7e9e3e86006a85c1edb1dde07ba406 (patch) | |
| tree | e62eda125d2ffc7bd2cc69969180fb89e8263b60 /llvm/lib | |
| parent | e8be73f3e7237400e3b55a2ac677931dfacb81e0 (diff) | |
| download | bcm5719-llvm-bf91499f1a7e9e3e86006a85c1edb1dde07ba406.tar.gz bcm5719-llvm-bf91499f1a7e9e3e86006a85c1edb1dde07ba406.zip | |
Schedule high latency instructions for latency reduction even if they are not vfp / NEON instructions.
llvm-svn: 105060
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Target/ARM/ARMISelLowering.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/llvm/lib/Target/ARM/ARMISelLowering.cpp b/llvm/lib/Target/ARM/ARMISelLowering.cpp index d724ba3a73a..ef2f07b70ed 100644 --- a/llvm/lib/Target/ARM/ARMISelLowering.cpp +++ b/llvm/lib/Target/ARM/ARMISelLowering.cpp @@ -605,11 +605,29 @@ unsigned ARMTargetLowering::getFunctionAlignment(const Function *F) const { } Sched::Preference ARMTargetLowering::getSchedulingPreference(SDNode *N) const { - for (unsigned i = 0, e = N->getNumValues(); i != e; ++i) { + unsigned NumVals = N->getNumValues(); + if (!NumVals) + return Sched::RegPressure; + + for (unsigned i = 0; i != NumVals; ++i) { EVT VT = N->getValueType(i); if (VT.isFloatingPoint() || VT.isVector()) return Sched::Latency; } + + if (!N->isMachineOpcode()) + return Sched::RegPressure; + + // Load are scheduled for latency even if there instruction itinerary + // is not available. + const TargetInstrInfo *TII = getTargetMachine().getInstrInfo(); + const TargetInstrDesc &TID = TII->get(N->getMachineOpcode()); + if (TID.mayLoad()) + return Sched::Latency; + + const InstrItineraryData &Itins = getTargetMachine().getInstrItineraryData(); + if (!Itins.isEmpty() && Itins.getStageLatency(TID.getSchedClass()) > 2) + return Sched::Latency; return Sched::RegPressure; } |

