LLVM  14.0.0git
InstructionSelect.h
Go to the documentation of this file.
1 //== llvm/CodeGen/GlobalISel/InstructionSelect.h -----------------*- C++ -*-==//
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 /// \file This file describes the interface of the MachineFunctionPass
9 /// responsible for selecting (possibly generic) machine instructions to
10 /// target-specific instructions.
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef LLVM_CODEGEN_GLOBALISEL_INSTRUCTIONSELECT_H
14 #define LLVM_CODEGEN_GLOBALISEL_INSTRUCTIONSELECT_H
15 
18 
19 namespace llvm {
20 
21 class BlockFrequencyInfo;
22 class ProfileSummaryInfo;
23 
24 /// This pass is responsible for selecting generic machine instructions to
25 /// target-specific instructions. It relies on the InstructionSelector provided
26 /// by the target.
27 /// Selection is done by examining blocks in post-order, and instructions in
28 /// reverse order.
29 ///
30 /// \post for all inst in MF: not isPreISelGenericOpcode(inst.opcode)
32 public:
33  static char ID;
34  StringRef getPassName() const override { return "InstructionSelect"; }
35 
36  void getAnalysisUsage(AnalysisUsage &AU) const override;
37 
43  }
44 
48  }
49 
52 
53  bool runOnMachineFunction(MachineFunction &MF) override;
54 
55 protected:
56  BlockFrequencyInfo *BFI = nullptr;
57  ProfileSummaryInfo *PSI = nullptr;
58 
60 };
61 } // End namespace llvm.
62 
63 #endif
llvm::InstructionSelect::InstructionSelect
InstructionSelect()
Definition: InstructionSelect.cpp:69
llvm
---------------------— PointerInfo ------------------------------------—
Definition: AllocatorList.h:23
llvm::InstructionSelect::OptLevel
CodeGenOpt::Level OptLevel
Definition: InstructionSelect.h:59
llvm::InstructionSelect::runOnMachineFunction
bool runOnMachineFunction(MachineFunction &MF) override
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformat...
Definition: InstructionSelect.cpp:84
llvm::MachineFunctionPass
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
Definition: MachineFunctionPass.h:30
llvm::MachineFunctionProperties::Property::IsSSA
@ IsSSA
llvm::MachineFunctionProperties
Properties which a MachineFunction may have at a given point in time.
Definition: MachineFunction.h:111
llvm::BlockFrequencyInfo
BlockFrequencyInfo pass uses BlockFrequencyInfoImpl implementation to estimate IR basic block frequen...
Definition: BlockFrequencyInfo.h:37
llvm::MachineFunctionProperties::Property::Selected
@ Selected
llvm::AnalysisUsage
Represent the analysis usage information of a pass.
Definition: PassAnalysisSupport.h:47
llvm::MachineFunctionProperties::set
MachineFunctionProperties & set(Property P)
Definition: MachineFunction.h:169
llvm::InstructionSelect
This pass is responsible for selecting generic machine instructions to target-specific instructions.
Definition: InstructionSelect.h:31
llvm::ProfileSummaryInfo
Analysis providing profile information.
Definition: ProfileSummaryInfo.h:39
InstructionSelector.h
llvm::InstructionSelect::BFI
BlockFrequencyInfo * BFI
Definition: InstructionSelect.h:56
MachineFunctionPass.h
llvm::MachineFunctionProperties::Property::RegBankSelected
@ RegBankSelected
llvm::MachineFunction
Definition: MachineFunction.h:230
llvm::CodeGenOpt::None
@ None
Definition: CodeGen.h:53
llvm::InstructionSelect::getPassName
StringRef getPassName() const override
getPassName - Return a nice clean name for a pass.
Definition: InstructionSelect.h:34
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
llvm::InstructionSelect::ID
static char ID
Definition: InstructionSelect.h:33
llvm::CodeGenOpt::Level
Level
Definition: CodeGen.h:52
llvm::InstructionSelect::PSI
ProfileSummaryInfo * PSI
Definition: InstructionSelect.h:57
llvm::InstructionSelect::getRequiredProperties
MachineFunctionProperties getRequiredProperties() const override
Definition: InstructionSelect.h:38
llvm::InstructionSelect::getSetProperties
MachineFunctionProperties getSetProperties() const override
Definition: InstructionSelect.h:45
llvm::InstructionSelect::getAnalysisUsage
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
Definition: InstructionSelect.cpp:72
llvm::MachineFunctionProperties::Property::Legalized
@ Legalized