InstructionSelect.h revision 314564
142575Speter//== llvm/CodeGen/GlobalISel/InstructionSelect.h -----------------*- C++ -*-==// 2168515Sgshapiro// 364562Sgshapiro// The LLVM Compiler Infrastructure 442575Speter// 542575Speter// This file is distributed under the University of Illinois Open Source 642575Speter// License. See LICENSE.TXT for details. 742575Speter// 842575Speter//===----------------------------------------------------------------------===// 942575Speter/// \file This file describes the interface of the MachineFunctionPass 1042575Speter/// responsible for selecting (possibly generic) machine instructions to 1164562Sgshapiro/// target-specific instructions. 1242575Speter//===----------------------------------------------------------------------===// 13249729Sgshapiro 1490792Sgshapiro#ifndef LLVM_CODEGEN_GLOBALISEL_INSTRUCTIONSELECT_H 15110560Sgshapiro#define LLVM_CODEGEN_GLOBALISEL_INSTRUCTIONSELECT_H 16110560Sgshapiro 1777349Sgshapiro#include "llvm/CodeGen/GlobalISel/InstructionSelector.h" 1890792Sgshapiro#include "llvm/CodeGen/MachineFunctionPass.h" 1990792Sgshapiro 2090792Sgshapironamespace llvm { 2190792Sgshapiro/// This pass is responsible for selecting generic machine instructions to 2290792Sgshapiro/// target-specific instructions. It relies on the InstructionSelector provided 2390792Sgshapiro/// by the target. 24168515Sgshapiro/// Selection is done by examining blocks in post-order, and instructions in 2564562Sgshapiro/// reverse order. 2677349Sgshapiro/// 2777349Sgshapiro/// \post for all inst in MF: not isPreISelGenericOpcode(inst.opcode) 2877349Sgshapiroclass InstructionSelect : public MachineFunctionPass { 2977349Sgshapiropublic: 3077349Sgshapiro static char ID; 3177349Sgshapiro StringRef getPassName() const override { return "InstructionSelect"; } 3277349Sgshapiro 3377349Sgshapiro void getAnalysisUsage(AnalysisUsage &AU) const override; 3477349Sgshapiro 3577349Sgshapiro MachineFunctionProperties getRequiredProperties() const override { 3677349Sgshapiro return MachineFunctionProperties() 3777349Sgshapiro .set(MachineFunctionProperties::Property::IsSSA) 3890792Sgshapiro .set(MachineFunctionProperties::Property::Legalized) 3990792Sgshapiro .set(MachineFunctionProperties::Property::RegBankSelected); 4077349Sgshapiro } 4177349Sgshapiro 4277349Sgshapiro MachineFunctionProperties getSetProperties() const override { 4377349Sgshapiro return MachineFunctionProperties().set( 4490792Sgshapiro MachineFunctionProperties::Property::Selected); 45141858Sgshapiro } 4642575Speter 4742575Speter InstructionSelect(); 4890792Sgshapiro 4942575Speter bool runOnMachineFunction(MachineFunction &MF) override; 5042575Speter}; 5142575Speter} // End namespace llvm. 5242575Speter 5342575Speter#endif 5442575Speter