Reed Kotler | 1595f36 | 2013-04-09 19:46:01 +0000 | [diff] [blame] | 1 | //===---- MipsModuleISelDAGToDAG.h - Change Subtarget --------===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file defines a pass used to change the subtarget for the |
| 11 | // Mips Instruction selector. |
| 12 | // |
| 13 | //===----------------------------------------------------------------------===// |
| 14 | |
Benjamin Kramer | a7c40ef | 2014-08-13 16:26:38 +0000 | [diff] [blame] | 15 | #ifndef LLVM_LIB_TARGET_MIPS_MIPSMODULEISELDAGTODAG_H |
| 16 | #define LLVM_LIB_TARGET_MIPS_MIPSMODULEISELDAGTODAG_H |
Reed Kotler | 1595f36 | 2013-04-09 19:46:01 +0000 | [diff] [blame] | 17 | |
| 18 | #include "Mips.h" |
| 19 | #include "MipsSubtarget.h" |
| 20 | #include "MipsTargetMachine.h" |
| 21 | #include "llvm/CodeGen/SelectionDAGISel.h" |
| 22 | |
| 23 | |
| 24 | //===----------------------------------------------------------------------===// |
| 25 | // Instruction Selector Implementation |
| 26 | //===----------------------------------------------------------------------===// |
| 27 | |
| 28 | //===----------------------------------------------------------------------===// |
| 29 | // MipsModuleDAGToDAGISel - MIPS specific code to select MIPS machine |
| 30 | // instructions for SelectionDAG operations. |
| 31 | //===----------------------------------------------------------------------===// |
| 32 | namespace llvm { |
| 33 | |
| 34 | class MipsModuleDAGToDAGISel : public MachineFunctionPass { |
| 35 | public: |
| 36 | |
| 37 | static char ID; |
| 38 | |
| 39 | explicit MipsModuleDAGToDAGISel(MipsTargetMachine &TM_) |
Eric Christopher | 4e7d1e7 | 2014-07-18 23:41:32 +0000 | [diff] [blame] | 40 | : MachineFunctionPass(ID), TM(TM_) {} |
Reed Kotler | 1595f36 | 2013-04-09 19:46:01 +0000 | [diff] [blame] | 41 | |
| 42 | // Pass Name |
Craig Topper | 56c590a | 2014-04-29 07:58:02 +0000 | [diff] [blame] | 43 | const char *getPassName() const override { |
Reed Kotler | 1595f36 | 2013-04-09 19:46:01 +0000 | [diff] [blame] | 44 | return "MIPS DAG->DAG Pattern Instruction Selection"; |
| 45 | } |
| 46 | |
Craig Topper | 56c590a | 2014-04-29 07:58:02 +0000 | [diff] [blame] | 47 | bool runOnMachineFunction(MachineFunction &MF) override; |
Reed Kotler | 1595f36 | 2013-04-09 19:46:01 +0000 | [diff] [blame] | 48 | |
| 49 | protected: |
Eric Christopher | 4e7d1e7 | 2014-07-18 23:41:32 +0000 | [diff] [blame] | 50 | MipsTargetMachine &TM; |
Reed Kotler | 1595f36 | 2013-04-09 19:46:01 +0000 | [diff] [blame] | 51 | }; |
| 52 | |
| 53 | /// createMipsISelDag - This pass converts a legalized DAG into a |
| 54 | /// MIPS-specific DAG, ready for instruction scheduling. |
| 55 | FunctionPass *createMipsModuleISelDag(MipsTargetMachine &TM); |
| 56 | } |
| 57 | |
| 58 | #endif |