LLVM 23.0.0git
LeonPasses.h
Go to the documentation of this file.
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//===----------------------------------------------------------------------===//
11
12#ifndef LLVM_LIB_TARGET_SPARC_LEON_PASSES_H
13#define LLVM_LIB_TARGET_SPARC_LEON_PASSES_H
14
16
17namespace llvm {
18class SparcSubtarget;
19
21 : public MachineFunctionPass {
22protected:
23 const SparcSubtarget *Subtarget = nullptr;
24 const int LAST_OPERAND = -1;
25
26 // this vector holds free registers that we allocate in groups for some of the
27 // LEON passes
28 std::vector<int> UsedRegisters;
29
30protected:
32
34
35 void markRegisterUsed(int registerIndex) {
36 UsedRegisters.push_back(registerIndex);
37 }
38};
39
67
69public:
70 static char ID;
71
73 bool runOnMachineFunction(MachineFunction &MF) override;
74
75 StringRef getPassName() const override {
76 return "InsertNOPLoad: Erratum Fix LBR35: insert a NOP instruction after "
77 "every single-cycle load instruction when the next instruction is "
78 "another load/store instruction";
79 }
80};
81
84public:
85 static char ID;
86
88 bool runOnMachineFunction(MachineFunction &MF) override;
89
90 StringRef getPassName() const override {
91 return "DetectRoundChange: Leon erratum detection: detect any rounding "
92 "mode change request: use only the round-to-nearest rounding mode";
93 }
94};
95
97public:
98 static char ID;
99
101 bool runOnMachineFunction(MachineFunction &MF) override;
102
103 StringRef getPassName() const override {
104 return "FixAllFDIVSQRT: Erratum Fix LBR34: fix FDIVS/FDIVD/FSQRTS/FSQRTD "
105 "instructions with NOPs and floating-point store";
106 }
107};
108} // namespace llvm
109
110#endif // LLVM_LIB_TARGET_SPARC_LEON_PASSES_H
MachineBasicBlock & MBB
#define LLVM_LIBRARY_VISIBILITY
Definition Compiler.h:137
#define I(x, y, z)
Definition MD5.cpp:57
bool runOnMachineFunction(MachineFunction &MF) override
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformat...
StringRef getPassName() const override
getPassName - Return a nice clean name for a pass.
Definition LeonPasses.h:90
bool checkSeqTN0009A(MachineBasicBlock::iterator I)
bool checkSeqTN0013(MachineBasicBlock::iterator I)
bool isAtomic(MachineBasicBlock::iterator I)
bool checkSeqTN0010First(MachineBasicBlock &MBB)
bool moveNext(MachineBasicBlock::iterator &I)
const SparcSubtarget * ST
Definition LeonPasses.h:42
bool checkSeqTN0012(MachineBasicBlock::iterator I)
bool checkSeqTN0010(MachineBasicBlock::iterator I)
bool checkSeqTN0009B(MachineBasicBlock::iterator I)
const TargetInstrInfo * TII
Definition LeonPasses.h:43
bool isDivSqrt(MachineBasicBlock::iterator I)
bool isFloat(MachineBasicBlock::iterator I)
bool runOnMachineFunction(MachineFunction &MF) override
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformat...
const TargetRegisterInfo * TRI
Definition LeonPasses.h:44
void insertNop(MachineBasicBlock::iterator I)
StringRef getPassName() const override
getPassName - Return a nice clean name for a pass.
Definition LeonPasses.h:65
bool runOnMachineFunction(MachineFunction &MF) override
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformat...
StringRef getPassName() const override
getPassName - Return a nice clean name for a pass.
Definition LeonPasses.h:103
StringRef getPassName() const override
getPassName - Return a nice clean name for a pass.
Definition LeonPasses.h:75
bool runOnMachineFunction(MachineFunction &MF) override
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformat...
const SparcSubtarget * Subtarget
Definition LeonPasses.h:23
void markRegisterUsed(int registerIndex)
Definition LeonPasses.h:35
std::vector< int > UsedRegisters
Definition LeonPasses.h:28
MachineInstrBundleIterator< MachineInstr > iterator
Represent a constant reference to a string, i.e.
Definition StringRef.h:56
TargetInstrInfo - Interface to description of machine instruction set.
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
Definition CallingConv.h:24
This is an optimization pass for GlobalISel generic memory operations.