Akira Hatanaka | 554d931 | 2013-03-14 18:27:31 +0000 | [diff] [blame] | 1 | //===-- MipsSEISelDAGToDAG.h - A Dag to Dag Inst Selector for MipsSE -----===// |
| 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 | // Subclass of MipsDAGToDAGISel specialized for mips32/64. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #ifndef MIPSSEISELDAGTODAG_H |
| 15 | #define MIPSSEISELDAGTODAG_H |
| 16 | |
| 17 | #include "MipsISelDAGToDAG.h" |
| 18 | |
| 19 | namespace llvm { |
| 20 | |
| 21 | class MipsSEDAGToDAGISel : public MipsDAGToDAGISel { |
| 22 | |
| 23 | public: |
| 24 | explicit MipsSEDAGToDAGISel(MipsTargetMachine &TM) : MipsDAGToDAGISel(TM) {} |
| 25 | |
| 26 | private: |
| 27 | bool ReplaceUsesWithZeroReg(MachineRegisterInfo *MRI, const MachineInstr&); |
| 28 | |
| 29 | std::pair<SDNode*, SDNode*> SelectMULT(SDNode *N, unsigned Opc, DebugLoc dl, |
| 30 | EVT Ty, bool HasLo, bool HasHi); |
| 31 | |
| 32 | virtual bool selectAddrRegImm(SDValue Addr, SDValue &Base, |
| 33 | SDValue &Offset) const; |
| 34 | |
| 35 | virtual bool selectAddrDefault(SDValue Addr, SDValue &Base, |
| 36 | SDValue &Offset) const; |
| 37 | |
| 38 | virtual bool selectIntAddr(SDValue Addr, SDValue &Base, |
| 39 | SDValue &Offset) const; |
| 40 | |
| 41 | virtual std::pair<bool, SDNode*> SelectNode(SDNode *Node); |
| 42 | |
| 43 | virtual void ProcessFunctionAfterISel(MachineFunction &MF); |
| 44 | |
| 45 | // Insert instructions to initialize the global base register in the |
| 46 | // first MBB of the function. |
| 47 | void InitGlobalBaseReg(MachineFunction &MF); |
| 48 | }; |
| 49 | |
| 50 | FunctionPass *createMipsSEISelDag(MipsTargetMachine &TM); |
| 51 | |
| 52 | } |
| 53 | |
| 54 | #endif |