[X86][BMI] Pull out schedule classes from bmi_andn<> and bmi_bls<>
[llvm-core.git] / lib / Target / Sparc / LeonPasses.h
blob154a2b467e16cf937c5afa8ca6da9fb4b68060b4
1 //===------- LeonPasses.h - Define passes specific to LEON ----------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 //
10 //===----------------------------------------------------------------------===//
12 #ifndef LLVM_LIB_TARGET_SPARC_LEON_PASSES_H
13 #define LLVM_LIB_TARGET_SPARC_LEON_PASSES_H
15 #include "llvm/CodeGen/MachineBasicBlock.h"
16 #include "llvm/CodeGen/MachineFunctionPass.h"
17 #include "llvm/CodeGen/Passes.h"
19 #include "Sparc.h"
20 #include "SparcSubtarget.h"
22 namespace llvm {
23 class LLVM_LIBRARY_VISIBILITY LEONMachineFunctionPass
24 : public MachineFunctionPass {
25 protected:
26 const SparcSubtarget *Subtarget;
27 const int LAST_OPERAND = -1;
29 // this vector holds free registers that we allocate in groups for some of the
30 // LEON passes
31 std::vector<int> UsedRegisters;
33 protected:
34 LEONMachineFunctionPass(char &ID);
36 int GetRegIndexForOperand(MachineInstr &MI, int OperandIndex);
37 void clearUsedRegisterList() { UsedRegisters.clear(); }
39 void markRegisterUsed(int registerIndex) {
40 UsedRegisters.push_back(registerIndex);
42 int getUnusedFPRegister(MachineRegisterInfo &MRI);
45 class LLVM_LIBRARY_VISIBILITY InsertNOPLoad : public LEONMachineFunctionPass {
46 public:
47 static char ID;
49 InsertNOPLoad();
50 bool runOnMachineFunction(MachineFunction &MF) override;
52 StringRef getPassName() const override {
53 return "InsertNOPLoad: Erratum Fix LBR35: insert a NOP instruction after "
54 "every single-cycle load instruction when the next instruction is "
55 "another load/store instruction";
59 class LLVM_LIBRARY_VISIBILITY DetectRoundChange
60 : public LEONMachineFunctionPass {
61 public:
62 static char ID;
64 DetectRoundChange();
65 bool runOnMachineFunction(MachineFunction &MF) override;
67 StringRef getPassName() const override {
68 return "DetectRoundChange: Leon erratum detection: detect any rounding "
69 "mode change request: use only the round-to-nearest rounding mode";
73 class LLVM_LIBRARY_VISIBILITY FixAllFDIVSQRT : public LEONMachineFunctionPass {
74 public:
75 static char ID;
77 FixAllFDIVSQRT();
78 bool runOnMachineFunction(MachineFunction &MF) override;
80 StringRef getPassName() const override {
81 return "FixAllFDIVSQRT: Erratum Fix LBR34: fix FDIVS/FDIVD/FSQRTS/FSQRTD "
82 "instructions with NOPs and floating-point store";
85 } // namespace llvm
87 #endif // LLVM_LIB_TARGET_SPARC_LEON_PASSES_H