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 | c10f5434b4ad0758f948c52c18d5740c7f44e8b3 (patch) | |
tree | 0974c973f289300688529d6b18c61b4080c4fd25 /lib/Target | |
parent | 2f05cc06a2dd1b5b7b2ae0d7e39f2ddf67649db2 (diff) | |
download | external_llvm-c10f5434b4ad0758f948c52c18d5740c7f44e8b3.zip external_llvm-c10f5434b4ad0758f948c52c18d5740c7f44e8b3.tar.gz external_llvm-c10f5434b4ad0758f948c52c18d5740c7f44e8b3.tar.bz2 |
Schedule high latency instructions for latency reduction even if they are not vfp / NEON instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105060 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r-- | lib/Target/ARM/ARMISelLowering.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/lib/Target/ARM/ARMISelLowering.cpp b/lib/Target/ARM/ARMISelLowering.cpp index d724ba3..ef2f07b 100644 --- a/lib/Target/ARM/ARMISelLowering.cpp +++ b/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; } |