LLVM 22.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
16#include "llvm/ADT/StringRef.h"
21
22namespace llvm {
23
28
29/// This pass is responsible for selecting generic machine instructions to
30/// target-specific instructions. It relies on the InstructionSelector provided
31/// by the target.
32/// Selection is done by examining blocks in post-order, and instructions in
33/// reverse order.
34///
35/// \post for all inst in MF: not isPreISelGenericOpcode(inst.opcode)
37public:
38 static char ID;
39 StringRef getPassName() const override { return "InstructionSelect"; }
40
41 void getAnalysisUsage(AnalysisUsage &AU) const override;
42
45 .setIsSSA()
46 .setLegalized()
47 .setRegBankSelected();
48 }
49
51 return MachineFunctionProperties().setSelected();
52 }
53
55 char &PassID = ID);
56
57 bool runOnMachineFunction(MachineFunction &MF) override;
58 bool selectMachineFunction(MachineFunction &MF);
59 void setInstructionSelector(InstructionSelector *NewISel) { ISel = NewISel; }
60
61protected:
62 class MIIteratorMaintainer;
63
68
70
72};
73} // End namespace llvm.
74
75#endif
#define LLVM_ABI
Definition Compiler.h:213
IRTranslator LLVM IR MI
Represent the analysis usage information of a pass.
BlockFrequencyInfo pass uses BlockFrequencyInfoImpl implementation to estimate IR basic block frequen...
This pass is responsible for selecting generic machine instructions to target-specific instructions.
InstructionSelector * ISel
MachineFunctionProperties getRequiredProperties() const override
void setInstructionSelector(InstructionSelector *NewISel)
InstructionSelect(CodeGenOptLevel OL=CodeGenOptLevel::Default, char &PassID=ID)
ProfileSummaryInfo * PSI
MachineFunctionProperties getSetProperties() const override
StringRef getPassName() const override
getPassName - Return a nice clean name for a pass.
bool selectInstr(MachineInstr &MI)
BlockFrequencyInfo * BFI
GISelValueTracking * VT
Properties which a MachineFunction may have at a given point in time.
Representation of each machine instruction.
Analysis providing profile information.
StringRef - Represent a constant reference to a string, i.e.
Definition StringRef.h:55
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.
CodeGenOptLevel
Code generation optimization level.
Definition CodeGen.h:82
@ Default
-O2, -Os
Definition CodeGen.h:85