diff options
Diffstat (limited to 'llvm/lib/Target/Sparc/LeonPasses.h')
-rwxr-xr-x | llvm/lib/Target/Sparc/LeonPasses.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/llvm/lib/Target/Sparc/LeonPasses.h b/llvm/lib/Target/Sparc/LeonPasses.h index ca4b0f90c82..798f63407e3 100755 --- a/llvm/lib/Target/Sparc/LeonPasses.h +++ b/llvm/lib/Target/Sparc/LeonPasses.h @@ -25,10 +25,19 @@ class LLVM_LIBRARY_VISIBILITY LEONMachineFunctionPass : public MachineFunctionPass { protected: const SparcSubtarget *Subtarget; + const int LAST_OPERAND = -1; + + //this vector holds free registers that we allocate in groups for some of the LEON passes + std::vector <int> UsedRegisters; protected: LEONMachineFunctionPass(TargetMachine &tm, char& ID); LEONMachineFunctionPass(char& ID); + + int GetRegIndexForOperand(MachineInstr& MI, int OperandIndex); + void clearUsedRegisterList(); + void markRegisterUsed(int registerIndex); + int getUnusedFPRegister(MachineRegisterInfo& MRI); }; class LLVM_LIBRARY_VISIBILITY InsertNOPLoad : public LEONMachineFunctionPass { @@ -42,6 +51,42 @@ public: return "InsertNOPLoad: Erratum Fix LBR35: insert a NOP instruction after every single-cycle load instruction when the next instruction is another load/store instruction"; } }; + +class LLVM_LIBRARY_VISIBILITY FixFSMULD : public LEONMachineFunctionPass { +public: + static char ID; + + FixFSMULD(TargetMachine &tm); + bool runOnMachineFunction(MachineFunction& MF) override; + + const char *getPassName() const override { + return "FixFSMULD: Erratum Fix LBR31: do not select FSMULD"; + } +}; + +class LLVM_LIBRARY_VISIBILITY ReplaceFMULS : public LEONMachineFunctionPass { +public: + static char ID; + + ReplaceFMULS(TargetMachine &tm); + bool runOnMachineFunction(MachineFunction& MF) override; + + const char *getPassName() const override { + return "ReplaceFMULS: Erratum Fix LBR32: replace FMULS instruction with a routine using conversions/double precision operations to replace FMULS"; + } +}; + +class LLVM_LIBRARY_VISIBILITY FixAllFDIVSQRT : public LEONMachineFunctionPass { +public: + static char ID; + + FixAllFDIVSQRT(TargetMachine &tm); + bool runOnMachineFunction(MachineFunction& MF) override; + + const char *getPassName() const override { + return "FixAllFDIVSQRT: Erratum Fix LBR34: fix FDIVS/FDIVD/FSQRTS/FSQRTD instructions with NOPs and floating-point store"; + } +}; } // namespace llvm #endif |