Chris Dewhurst | 4f7cac3 | 2016-05-23 10:56:36 +0000 | [diff] [blame] | 1 | //===------- LeonPasses.h - Define passes specific to LEON ----------------===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // |
| 11 | //===----------------------------------------------------------------------===// |
| 12 | |
| 13 | #ifndef LLVM_LIB_TARGET_SPARC_LEON_PASSES_H |
| 14 | #define LLVM_LIB_TARGET_SPARC_LEON_PASSES_H |
| 15 | |
| 16 | #include "llvm/CodeGen/Passes.h" |
| 17 | #include "llvm/CodeGen/MachineFunctionPass.h" |
| 18 | #include "llvm/CodeGen/MachineBasicBlock.h" |
| 19 | |
| 20 | #include "Sparc.h" |
| 21 | #include "SparcSubtarget.h" |
| 22 | |
Benjamin Kramer | 797fb96 | 2016-05-27 10:06:27 +0000 | [diff] [blame^] | 23 | namespace llvm { |
| 24 | class LLVM_LIBRARY_VISIBILITY LEONMachineFunctionPass |
| 25 | : public MachineFunctionPass { |
Chris Dewhurst | 4f7cac3 | 2016-05-23 10:56:36 +0000 | [diff] [blame] | 26 | protected: |
| 27 | const SparcSubtarget *Subtarget; |
| 28 | |
| 29 | protected: |
| 30 | LEONMachineFunctionPass(TargetMachine &tm, char& ID); |
| 31 | LEONMachineFunctionPass(char& ID); |
| 32 | }; |
| 33 | |
Benjamin Kramer | 797fb96 | 2016-05-27 10:06:27 +0000 | [diff] [blame^] | 34 | class LLVM_LIBRARY_VISIBILITY InsertNOPLoad : public LEONMachineFunctionPass { |
Chris Dewhurst | 4f7cac3 | 2016-05-23 10:56:36 +0000 | [diff] [blame] | 35 | public: |
| 36 | static char ID; |
| 37 | |
| 38 | InsertNOPLoad(TargetMachine &tm); |
| 39 | bool runOnMachineFunction(MachineFunction& MF) override; |
| 40 | |
| 41 | const char *getPassName() const override { |
| 42 | return "InsertNOPLoad: Erratum Fix LBR35: insert a NOP instruction after every single-cycle load instruction when the next instruction is another load/store instruction"; |
| 43 | } |
| 44 | }; |
Benjamin Kramer | 797fb96 | 2016-05-27 10:06:27 +0000 | [diff] [blame^] | 45 | } // namespace llvm |
Chris Dewhurst | 4f7cac3 | 2016-05-23 10:56:36 +0000 | [diff] [blame] | 46 | |
| 47 | #endif |