diff options
author | Hal Finkel <hfinkel@anl.gov> | 2012-03-31 14:45:15 +0000 |
---|---|---|
committer | Hal Finkel <hfinkel@anl.gov> | 2012-03-31 14:45:15 +0000 |
commit | 51861b4855853158b9b35d78d46000af8cc1f500 (patch) | |
tree | 75f7e0076cab8fd8f25662b0a7c4c69ada75a16a /llvm/lib/Target/PowerPC/PPCHazardRecognizers.h | |
parent | 1a4cc6cc9fb3c5a51bae173acf6dab3285c321da (diff) | |
download | bcm5719-llvm-51861b4855853158b9b35d78d46000af8cc1f500.tar.gz bcm5719-llvm-51861b4855853158b9b35d78d46000af8cc1f500.zip |
Fix dynamic linking on PPC64.
Dynamic linking on PPC64 has had problems since we had to move the top-down
hazard-detection logic post-ra. For dynamic linking to work there needs to be
a nop placed after every call. It turns out that it is really hard to guarantee
that nothing will be placed in between the call (bl) and the nop during post-ra
scheduling. Previous attempts at fixing this by placing logic inside the
hazard detector only partially worked.
This is now fixed in a different way: call+nop codegen-only instructions. As far
as CodeGen is concerned the pair is now a single instruction and cannot be split.
This solution works much better than previous attempts.
The scoreboard hazard detector is also renamed to be more generic, there is currently
no cpu-specific logic in it.
llvm-svn: 153816
Diffstat (limited to 'llvm/lib/Target/PowerPC/PPCHazardRecognizers.h')
-rw-r--r-- | llvm/lib/Target/PowerPC/PPCHazardRecognizers.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCHazardRecognizers.h b/llvm/lib/Target/PowerPC/PPCHazardRecognizers.h index d80a3850b01..55b45d01b20 100644 --- a/llvm/lib/Target/PowerPC/PPCHazardRecognizers.h +++ b/llvm/lib/Target/PowerPC/PPCHazardRecognizers.h @@ -21,16 +21,19 @@ namespace llvm { -/// PPCHazardRecognizer440 - This class implements a scoreboard-based -/// hazard recognizer for the PPC 440 and friends. -class PPCHazardRecognizer440 : public ScoreboardHazardRecognizer { +/// PPCScoreboardHazardRecognizer - This class implements a scoreboard-based +/// hazard recognizer for generic PPC processors. +class PPCScoreboardHazardRecognizer : public ScoreboardHazardRecognizer { const ScheduleDAG *DAG; public: - PPCHazardRecognizer440(const InstrItineraryData *ItinData, + PPCScoreboardHazardRecognizer(const InstrItineraryData *ItinData, const ScheduleDAG *DAG_) : ScoreboardHazardRecognizer(ItinData, DAG_), DAG(DAG_) {} + virtual HazardType getHazardType(SUnit *SU, int Stalls); virtual void EmitInstruction(SUnit *SU); + virtual void AdvanceCycle(); + virtual void Reset(); }; /// PPCHazardRecognizer970 - This class defines a finite state automata that @@ -49,9 +52,6 @@ class PPCHazardRecognizer970 : public ScheduleHazardRecognizer { // HasCTRSet - If the CTR register is set in this group, disallow BCTRL. bool HasCTRSet; - // Was the last instruction issued a BL8_ELF - bool LastWasBL8_ELF; - // StoredPtr - Keep track of the address of any store. If we see a load from // the same address (or one that aliases it), disallow the store. We can have // up to four stores in one dispatch group, hence we track up to 4. |