diff options
author | Andrew Trick <atrick@apple.com> | 2011-01-21 05:51:33 +0000 |
---|---|---|
committer | Andrew Trick <atrick@apple.com> | 2011-01-21 05:51:33 +0000 |
commit | c8bfd1d78ff9a307d1d4cb57cce4549b538e60f4 (patch) | |
tree | 13af786aec75effa04412a01b22f838fdeee111f /lib/Target/ARM | |
parent | cd151d2f95eabae61b3cf8e675717d5674afbe85 (diff) | |
download | external_llvm-c8bfd1d78ff9a307d1d4cb57cce4549b538e60f4.zip external_llvm-c8bfd1d78ff9a307d1d4cb57cce4549b538e60f4.tar.gz external_llvm-c8bfd1d78ff9a307d1d4cb57cce4549b538e60f4.tar.bz2 |
Convert -enable-sched-cycles and -enable-sched-hazard to -disable
flags. They are still not enable in this revision.
Added TargetInstrInfo::isZeroCost() to fix a fundamental problem with
the scheduler's model of operand latency in the selection DAG.
Generalized unit tests to work with sched-cycles.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123969 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM')
-rw-r--r-- | lib/Target/ARM/ARMBaseInstrInfo.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/lib/Target/ARM/ARMBaseInstrInfo.cpp b/lib/Target/ARM/ARMBaseInstrInfo.cpp index aaf4f0d..4f44c8e 100644 --- a/lib/Target/ARM/ARMBaseInstrInfo.cpp +++ b/lib/Target/ARM/ARMBaseInstrInfo.cpp @@ -41,14 +41,6 @@ static cl::opt<bool> EnableARM3Addr("enable-arm-3-addr-conv", cl::Hidden, cl::desc("Enable ARM 2-addr to 3-addr conv")); -// Other targets already have a hazard recognizer enabled by default, so this -// flag currently only affects ARM. It will be generalized when it becomes a -// disabled flag. -static cl::opt<bool> EnableHazardRecognizer( - "enable-sched-hazard", cl::Hidden, - cl::desc("Enable hazard detection during preRA scheduling"), - cl::init(false)); - /// ARM_MLxEntry - Record information about MLA / MLS instructions. struct ARM_MLxEntry { unsigned MLxOpc; // MLA / MLS opcode @@ -97,7 +89,7 @@ ARMBaseInstrInfo::ARMBaseInstrInfo(const ARMSubtarget& STI) ScheduleHazardRecognizer *ARMBaseInstrInfo:: CreateTargetHazardRecognizer(const TargetMachine *TM, const ScheduleDAG *DAG) const { - if (EnableHazardRecognizer) { + if (usePreRAHazardRecognizer()) { const InstrItineraryData *II = TM->getInstrItineraryData(); return new ScoreboardHazardRecognizer(II, DAG, "pre-RA-sched"); } @@ -2173,6 +2165,10 @@ ARMBaseInstrInfo::getOperandLatency(const InstrItineraryData *ItinData, return 1; const TargetInstrDesc &DefTID = get(DefNode->getMachineOpcode()); + + if (isZeroCost(DefTID.Opcode)) + return 0; + if (!ItinData || ItinData->isEmpty()) return DefTID.mayLoad() ? 3 : 1; |