1 //===---- MipsModuleISelDAGToDAG.h - Change Subtarget --------===//
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 //===----------------------------------------------------------------------===//
10 // This file defines a pass used to change the subtarget for the
11 // Mips Instruction selector.
13 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_LIB_TARGET_MIPS_MIPSMODULEISELDAGTODAG_H
16 #define LLVM_LIB_TARGET_MIPS_MIPSMODULEISELDAGTODAG_H
19 #include "MipsSubtarget.h"
20 #include "MipsTargetMachine.h"
21 #include "llvm/CodeGen/SelectionDAGISel.h"
24 //===----------------------------------------------------------------------===//
25 // Instruction Selector Implementation
26 //===----------------------------------------------------------------------===//
28 //===----------------------------------------------------------------------===//
29 // MipsModuleDAGToDAGISel - MIPS specific code to select MIPS machine
30 // instructions for SelectionDAG operations.
31 //===----------------------------------------------------------------------===//
34 class MipsModuleDAGToDAGISel : public MachineFunctionPass {
39 explicit MipsModuleDAGToDAGISel(MipsTargetMachine &TM_)
40 : MachineFunctionPass(ID), TM(TM_) {}
43 const char *getPassName() const override {
44 return "MIPS DAG->DAG Pattern Instruction Selection";
47 bool runOnMachineFunction(MachineFunction &MF) override;
50 MipsTargetMachine &TM;
53 /// createMipsISelDag - This pass converts a legalized DAG into a
54 /// MIPS-specific DAG, ready for instruction scheduling.
55 FunctionPass *createMipsModuleISelDag(MipsTargetMachine &TM);