1 //== llvm/CodeGen/GlobalISel/InstructionSelect.h -----------------*- C++ -*-==//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
9 /// \file This file describes the interface of the MachineFunctionPass
10 /// responsible for selecting (possibly generic) machine instructions to
11 /// target-specific instructions.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_CODEGEN_GLOBALISEL_INSTRUCTIONSELECT_H
15 #define LLVM_CODEGEN_GLOBALISEL_INSTRUCTIONSELECT_H
17 #include "llvm/CodeGen/GlobalISel/InstructionSelector.h"
18 #include "llvm/CodeGen/MachineFunctionPass.h"
21 /// This pass is responsible for selecting generic machine instructions to
22 /// target-specific instructions. It relies on the InstructionSelector provided
24 /// Selection is done by examining blocks in post-order, and instructions in
27 /// \post for all inst in MF: not isPreISelGenericOpcode(inst.opcode)
28 class InstructionSelect : public MachineFunctionPass {
31 StringRef getPassName() const override { return "InstructionSelect"; }
33 void getAnalysisUsage(AnalysisUsage &AU) const override;
35 MachineFunctionProperties getRequiredProperties() const override {
36 return MachineFunctionProperties()
37 .set(MachineFunctionProperties::Property::IsSSA)
38 .set(MachineFunctionProperties::Property::Legalized)
39 .set(MachineFunctionProperties::Property::RegBankSelected);
42 MachineFunctionProperties getSetProperties() const override {
43 return MachineFunctionProperties().set(
44 MachineFunctionProperties::Property::Selected);
49 bool runOnMachineFunction(MachineFunction &MF) override;
51 } // End namespace llvm.