1 //===-- MipsSEISelDAGToDAG.h - A Dag to Dag Inst Selector for MipsSE -----===//
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 // Subclass of MipsDAGToDAGISel specialized for mips32/64.
12 //===----------------------------------------------------------------------===//
14 #ifndef MIPSSEISELDAGTODAG_H
15 #define MIPSSEISELDAGTODAG_H
17 #include "MipsISelDAGToDAG.h"
21 class MipsSEDAGToDAGISel : public MipsDAGToDAGISel {
24 explicit MipsSEDAGToDAGISel(MipsTargetMachine &TM) : MipsDAGToDAGISel(TM) {}
28 virtual bool runOnMachineFunction(MachineFunction &MF);
30 void addDSPCtrlRegOperands(bool IsDef, MachineInstr &MI,
33 bool replaceUsesWithZeroReg(MachineRegisterInfo *MRI, const MachineInstr&);
35 std::pair<SDNode*, SDNode*> selectMULT(SDNode *N, unsigned Opc, SDLoc dl,
36 EVT Ty, bool HasLo, bool HasHi);
38 SDNode *selectAddESubE(unsigned MOp, SDValue InFlag, SDValue CmpLHS,
39 SDLoc DL, SDNode *Node) const;
41 virtual bool selectAddrRegImm(SDValue Addr, SDValue &Base,
42 SDValue &Offset) const;
44 virtual bool selectAddrDefault(SDValue Addr, SDValue &Base,
45 SDValue &Offset) const;
47 virtual bool selectIntAddr(SDValue Addr, SDValue &Base,
48 SDValue &Offset) const;
50 virtual bool selectAddrRegImm12(SDValue Addr, SDValue &Base,
51 SDValue &Offset) const;
53 virtual bool selectIntAddrMM(SDValue Addr, SDValue &Base,
54 SDValue &Offset) const;
56 virtual std::pair<bool, SDNode*> selectNode(SDNode *Node);
58 virtual void processFunctionAfterISel(MachineFunction &MF);
60 // Insert instructions to initialize the global base register in the
61 // first MBB of the function.
62 void initGlobalBaseReg(MachineFunction &MF);
65 FunctionPass *createMipsSEISelDag(MipsTargetMachine &TM);