MipsSEISelDAGToDAG.h revision a430cb613b6e93c05f128b04323c57acfd08686d
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 19namespace llvm { 20 21class MipsSEDAGToDAGISel : public MipsDAGToDAGISel { 22 23public: 24 explicit MipsSEDAGToDAGISel(MipsTargetMachine &TM) : MipsDAGToDAGISel(TM) {} 25 26private: 27 28 virtual bool runOnMachineFunction(MachineFunction &MF); 29 30 bool replaceUsesWithZeroReg(MachineRegisterInfo *MRI, const MachineInstr&); 31 32 std::pair<SDNode*, SDNode*> selectMULT(SDNode *N, unsigned Opc, DebugLoc dl, 33 EVT Ty, bool HasLo, bool HasHi); 34 35 SDNode *selectAddESubE(unsigned MOp, SDValue InFlag, SDValue CmpLHS, 36 DebugLoc DL, SDNode *Node) const; 37 38 virtual bool selectAddrRegImm(SDValue Addr, SDValue &Base, 39 SDValue &Offset) const; 40 41 virtual bool selectAddrDefault(SDValue Addr, SDValue &Base, 42 SDValue &Offset) const; 43 44 virtual bool selectIntAddr(SDValue Addr, SDValue &Base, 45 SDValue &Offset) const; 46 47 virtual std::pair<bool, SDNode*> selectNode(SDNode *Node); 48 49 virtual void processFunctionAfterISel(MachineFunction &MF); 50 51 // Insert instructions to initialize the global base register in the 52 // first MBB of the function. 53 void initGlobalBaseReg(MachineFunction &MF); 54}; 55 56FunctionPass *createMipsSEISelDag(MipsTargetMachine &TM); 57 58} 59 60#endif 61