LLVM API Documentation
00001 //===---- MipsModuleISelDAGToDAG.h - Change Subtarget --------===// 00002 // 00003 // The LLVM Compiler Infrastructure 00004 // 00005 // This file is distributed under the University of Illinois Open Source 00006 // License. See LICENSE.TXT for details. 00007 // 00008 //===----------------------------------------------------------------------===// 00009 // 00010 // This file defines a pass used to change the subtarget for the 00011 // Mips Instruction selector. 00012 // 00013 //===----------------------------------------------------------------------===// 00014 00015 #ifndef LLVM_LIB_TARGET_MIPS_MIPSMODULEISELDAGTODAG_H 00016 #define LLVM_LIB_TARGET_MIPS_MIPSMODULEISELDAGTODAG_H 00017 00018 #include "Mips.h" 00019 #include "MipsSubtarget.h" 00020 #include "MipsTargetMachine.h" 00021 #include "llvm/CodeGen/SelectionDAGISel.h" 00022 00023 00024 //===----------------------------------------------------------------------===// 00025 // Instruction Selector Implementation 00026 //===----------------------------------------------------------------------===// 00027 00028 //===----------------------------------------------------------------------===// 00029 // MipsModuleDAGToDAGISel - MIPS specific code to select MIPS machine 00030 // instructions for SelectionDAG operations. 00031 //===----------------------------------------------------------------------===// 00032 namespace llvm { 00033 00034 class MipsModuleDAGToDAGISel : public MachineFunctionPass { 00035 public: 00036 00037 static char ID; 00038 00039 explicit MipsModuleDAGToDAGISel(MipsTargetMachine &TM_) 00040 : MachineFunctionPass(ID), TM(TM_) {} 00041 00042 // Pass Name 00043 const char *getPassName() const override { 00044 return "MIPS DAG->DAG Pattern Instruction Selection"; 00045 } 00046 00047 bool runOnMachineFunction(MachineFunction &MF) override; 00048 00049 protected: 00050 MipsTargetMachine &TM; 00051 }; 00052 00053 /// createMipsISelDag - This pass converts a legalized DAG into a 00054 /// MIPS-specific DAG, ready for instruction scheduling. 00055 FunctionPass *createMipsModuleISelDag(MipsTargetMachine &TM); 00056 } 00057 00058 #endif