diff options
author | Andrew Trick <atrick@apple.com> | 2010-12-08 20:04:29 +0000 |
---|---|---|
committer | Andrew Trick <atrick@apple.com> | 2010-12-08 20:04:29 +0000 |
commit | 6b1207267f01877ff9b351786c902cb2ecd354c0 (patch) | |
tree | 8a830ff262d3e13ca871ea01b172ff8e5583a238 /lib/Target/ARM | |
parent | cd466f582aa83074294ab1a31b26eedd5a2fd025 (diff) |
Generalize PostRAHazardRecognizer so it can be used in any pass for
both forward and backward scheduling. Rename it to
ScoreboardHazardRecognizer (Scoreboard is one word). Remove integer
division from the scoreboard's critical path.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121274 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM')
-rw-r--r-- | lib/Target/ARM/ARMHazardRecognizer.cpp | 12 | ||||
-rw-r--r-- | lib/Target/ARM/ARMHazardRecognizer.h | 8 |
2 files changed, 12 insertions, 8 deletions
diff --git a/lib/Target/ARM/ARMHazardRecognizer.cpp b/lib/Target/ARM/ARMHazardRecognizer.cpp index 317934faec..b8d385b6e3 100644 --- a/lib/Target/ARM/ARMHazardRecognizer.cpp +++ b/lib/Target/ARM/ARMHazardRecognizer.cpp @@ -68,14 +68,14 @@ ARMHazardRecognizer::getHazardType(SUnit *SU) { } } - return PostRAHazardRecognizer::getHazardType(SU); + return ScoreboardHazardRecognizer::getHazardType(SU); } void ARMHazardRecognizer::Reset() { LastMI = 0; Stalls = 0; ITBlockSize = 0; - PostRAHazardRecognizer::Reset(); + ScoreboardHazardRecognizer::Reset(); } void ARMHazardRecognizer::EmitInstruction(SUnit *SU) { @@ -103,12 +103,16 @@ void ARMHazardRecognizer::EmitInstruction(SUnit *SU) { Stalls = 0; } - PostRAHazardRecognizer::EmitInstruction(SU); + ScoreboardHazardRecognizer::EmitInstruction(SU); } void ARMHazardRecognizer::AdvanceCycle() { if (Stalls && --Stalls == 0) // Stalled for 4 cycles but still can't schedule any other instructions. LastMI = 0; - PostRAHazardRecognizer::AdvanceCycle(); + ScoreboardHazardRecognizer::AdvanceCycle(); +} + +void ARMHazardRecognizer::RecedeCycle() { + llvm_unreachable("reverse ARM hazard checking unsupported"); } diff --git a/lib/Target/ARM/ARMHazardRecognizer.h b/lib/Target/ARM/ARMHazardRecognizer.h index d1919d8cf4..9473bc5207 100644 --- a/lib/Target/ARM/ARMHazardRecognizer.h +++ b/lib/Target/ARM/ARMHazardRecognizer.h @@ -14,7 +14,7 @@ #ifndef ARMHAZARDRECOGNIZER_H #define ARMHAZARDRECOGNIZER_H -#include "llvm/CodeGen/PostRAHazardRecognizer.h" +#include "llvm/CodeGen/ScoreboardHazardRecognizer.h" namespace llvm { @@ -23,7 +23,7 @@ class ARMBaseRegisterInfo; class ARMSubtarget; class MachineInstr; -class ARMHazardRecognizer : public PostRAHazardRecognizer { +class ARMHazardRecognizer : public ScoreboardHazardRecognizer { const ARMBaseInstrInfo &TII; const ARMBaseRegisterInfo &TRI; const ARMSubtarget &STI; @@ -38,16 +38,16 @@ public: const ARMBaseInstrInfo &tii, const ARMBaseRegisterInfo &tri, const ARMSubtarget &sti) : - PostRAHazardRecognizer(ItinData), TII(tii), TRI(tri), STI(sti), + ScoreboardHazardRecognizer(ItinData), TII(tii), TRI(tri), STI(sti), LastMI(0), ITBlockSize(0) {} virtual HazardType getHazardType(SUnit *SU); virtual void Reset(); virtual void EmitInstruction(SUnit *SU); virtual void AdvanceCycle(); + virtual void RecedeCycle(); }; - } // end namespace llvm #endif // ARMHAZARDRECOGNIZER_H |