LLVM  14.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 
17 namespace llvm {
18 class SparcSubtarget;
19 
21  : public MachineFunctionPass {
22 protected:
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 
30 protected:
32 
33  void clearUsedRegisterList() { UsedRegisters.clear(); }
34 
35  void markRegisterUsed(int registerIndex) {
36  UsedRegisters.push_back(registerIndex);
37  }
38 };
39 
41 public:
42  static char ID;
43 
44  InsertNOPLoad();
45  bool runOnMachineFunction(MachineFunction &MF) override;
46 
47  StringRef getPassName() const override {
48  return "InsertNOPLoad: Erratum Fix LBR35: insert a NOP instruction after "
49  "every single-cycle load instruction when the next instruction is "
50  "another load/store instruction";
51  }
52 };
53 
55  : public LEONMachineFunctionPass {
56 public:
57  static char ID;
58 
60  bool runOnMachineFunction(MachineFunction &MF) override;
61 
62  StringRef getPassName() const override {
63  return "DetectRoundChange: Leon erratum detection: detect any rounding "
64  "mode change request: use only the round-to-nearest rounding mode";
65  }
66 };
67 
69 public:
70  static char ID;
71 
73  bool runOnMachineFunction(MachineFunction &MF) override;
74 
75  StringRef getPassName() const override {
76  return "FixAllFDIVSQRT: Erratum Fix LBR34: fix FDIVS/FDIVD/FSQRTS/FSQRTD "
77  "instructions with NOPs and floating-point store";
78  }
79 };
80 } // namespace llvm
81 
82 #endif // LLVM_LIB_TARGET_SPARC_LEON_PASSES_H
llvm
This file implements support for optimizing divisions by a constant.
Definition: AllocatorList.h:23
llvm::DetectRoundChange::getPassName
StringRef getPassName() const override
getPassName - Return a nice clean name for a pass.
Definition: LeonPasses.h:62
llvm::MachineFunctionPass
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
Definition: MachineFunctionPass.h:30
llvm::DetectRoundChange::ID
static char ID
Definition: LeonPasses.h:57
llvm::InsertNOPLoad::ID
static char ID
Definition: LeonPasses.h:42
llvm::FixAllFDIVSQRT::getPassName
StringRef getPassName() const override
getPassName - Return a nice clean name for a pass.
Definition: LeonPasses.h:75
llvm::DetectRoundChange
Definition: LeonPasses.h:54
llvm::SparcSubtarget
Definition: SparcSubtarget.h:31
llvm::InsertNOPLoad
Definition: LeonPasses.h:40
llvm::FixAllFDIVSQRT
Definition: LeonPasses.h:68
llvm::LEONMachineFunctionPass::markRegisterUsed
void markRegisterUsed(int registerIndex)
Definition: LeonPasses.h:35
llvm::InsertNOPLoad::getPassName
StringRef getPassName() const override
getPassName - Return a nice clean name for a pass.
Definition: LeonPasses.h:47
llvm::FixAllFDIVSQRT::ID
static char ID
Definition: LeonPasses.h:70
MachineFunctionPass.h
llvm::MachineFunction
Definition: MachineFunction.h:230
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
LLVM_LIBRARY_VISIBILITY
#define LLVM_LIBRARY_VISIBILITY
LLVM_LIBRARY_VISIBILITY - If a class marked with this attribute is linked into a shared library,...
Definition: Compiler.h:131
llvm::LEONMachineFunctionPass::clearUsedRegisterList
void clearUsedRegisterList()
Definition: LeonPasses.h:33
llvm::LEONMachineFunctionPass::UsedRegisters
std::vector< int > UsedRegisters
Definition: LeonPasses.h:28
llvm::Intrinsic::ID
unsigned ID
Definition: TargetTransformInfo.h:37
llvm::LEONMachineFunctionPass
Definition: LeonPasses.h:20