1249259Sdim//===---- Mips16ISelDAGToDAG.h - A Dag to Dag Inst Selector for Mips ------===// 2249259Sdim// 3249259Sdim// The LLVM Compiler Infrastructure 4249259Sdim// 5249259Sdim// This file is distributed under the University of Illinois Open Source 6249259Sdim// License. See LICENSE.TXT for details. 7249259Sdim// 8249259Sdim//===----------------------------------------------------------------------===// 9249259Sdim// 10249259Sdim// Subclass of MipsDAGToDAGISel specialized for mips16. 11249259Sdim// 12249259Sdim//===----------------------------------------------------------------------===// 13249259Sdim 14249259Sdim#ifndef MIPS16ISELDAGTODAG_H 15249259Sdim#define MIPS16ISELDAGTODAG_H 16249259Sdim 17249259Sdim#include "MipsISelDAGToDAG.h" 18249259Sdim 19249259Sdimnamespace llvm { 20249259Sdim 21249259Sdimclass Mips16DAGToDAGISel : public MipsDAGToDAGISel { 22249259Sdimpublic: 23249259Sdim explicit Mips16DAGToDAGISel(MipsTargetMachine &TM) : MipsDAGToDAGISel(TM) {} 24249259Sdim 25249259Sdimprivate: 26263508Sdim std::pair<SDNode*, SDNode*> selectMULT(SDNode *N, unsigned Opc, SDLoc DL, 27249259Sdim EVT Ty, bool HasLo, bool HasHi); 28249259Sdim 29249259Sdim SDValue getMips16SPAliasReg(); 30249259Sdim 31251662Sdim virtual bool runOnMachineFunction(MachineFunction &MF); 32251662Sdim 33249259Sdim void getMips16SPRefReg(SDNode *Parent, SDValue &AliasReg); 34249259Sdim 35249259Sdim virtual bool selectAddr16(SDNode *Parent, SDValue N, SDValue &Base, 36249259Sdim SDValue &Offset, SDValue &Alias); 37249259Sdim 38249259Sdim virtual std::pair<bool, SDNode*> selectNode(SDNode *Node); 39249259Sdim 40249259Sdim virtual void processFunctionAfterISel(MachineFunction &MF); 41249259Sdim 42249259Sdim // Insert instructions to initialize the global base register in the 43249259Sdim // first MBB of the function. 44249259Sdim void initGlobalBaseReg(MachineFunction &MF); 45249259Sdim 46249259Sdim void initMips16SPAliasReg(MachineFunction &MF); 47249259Sdim}; 48249259Sdim 49249259SdimFunctionPass *createMips16ISelDag(MipsTargetMachine &TM); 50249259Sdim 51249259Sdim} 52249259Sdim 53249259Sdim#endif 54