| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
#ifndef LLVM_CODEGEN_GLOBALISEL_INSTRUCTIONSELECT_H |
| 14 |
#define LLVM_CODEGEN_GLOBALISEL_INSTRUCTIONSELECT_H |
| 15 |
|
| 16 |
#include "llvm/CodeGen/GlobalISel/InstructionSelector.h" |
| 17 |
#include "llvm/CodeGen/MachineFunctionPass.h" |
| 18 |
|
| 19 |
namespace llvm { |
| 20 |
|
| 21 |
class BlockFrequencyInfo; |
| 22 |
class ProfileSummaryInfo; |
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
class InstructionSelect : public MachineFunctionPass { |
| 32 |
public: |
| 33 |
static char ID; |
| 34 |
StringRef getPassName() const override { return "InstructionSelect"; } |
| 35 |
|
| 36 |
void getAnalysisUsage(AnalysisUsage &AU) const override; |
| 37 |
|
| 38 |
MachineFunctionProperties getRequiredProperties() const override { |
| 39 |
return MachineFunctionProperties() |
| 40 |
.set(MachineFunctionProperties::Property::IsSSA) |
| 41 |
.set(MachineFunctionProperties::Property::Legalized) |
| 42 |
.set(MachineFunctionProperties::Property::RegBankSelected); |
| 43 |
} |
| 44 |
|
| 45 |
MachineFunctionProperties getSetProperties() const override { |
| 46 |
return MachineFunctionProperties().set( |
| 47 |
MachineFunctionProperties::Property::Selected); |
| 48 |
} |
| 49 |
|
| 50 |
InstructionSelect(CodeGenOpt::Level OL); |
| 51 |
InstructionSelect(); |
| 52 |
|
| 53 |
bool runOnMachineFunction(MachineFunction &MF) override; |
| 54 |
|
| 55 |
protected: |
| 56 |
BlockFrequencyInfo *BFI = nullptr; |
| 57 |
ProfileSummaryInfo *PSI = nullptr; |
| 58 |
|
| 59 |
CodeGenOpt::Level OptLevel = CodeGenOpt::None; |
| 60 |
}; |
| 61 |
} |
| 62 |
|
| 63 |
#endif |