]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - contrib/llvm/lib/Target/Mips/Mips16ISelDAGToDAG.h
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / contrib / llvm / lib / Target / Mips / Mips16ISelDAGToDAG.h
1 //===---- Mips16ISelDAGToDAG.h - A Dag to Dag Inst Selector for Mips ------===//
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 mips16.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef MIPS16ISELDAGTODAG_H
15 #define MIPS16ISELDAGTODAG_H
16
17 #include "MipsISelDAGToDAG.h"
18
19 namespace llvm {
20
21 class Mips16DAGToDAGISel : public MipsDAGToDAGISel {
22 public:
23   explicit Mips16DAGToDAGISel(MipsTargetMachine &TM) : MipsDAGToDAGISel(TM) {}
24
25 private:
26   std::pair<SDNode*, SDNode*> selectMULT(SDNode *N, unsigned Opc, DebugLoc DL,
27                                          EVT Ty, bool HasLo, bool HasHi);
28
29   SDValue getMips16SPAliasReg();
30
31   virtual bool runOnMachineFunction(MachineFunction &MF);
32
33   void getMips16SPRefReg(SDNode *Parent, SDValue &AliasReg);
34
35   virtual bool selectAddr16(SDNode *Parent, SDValue N, SDValue &Base,
36                             SDValue &Offset, SDValue &Alias);
37
38   virtual std::pair<bool, SDNode*> selectNode(SDNode *Node);
39
40   virtual void processFunctionAfterISel(MachineFunction &MF);
41
42   // Insert instructions to initialize the global base register in the
43   // first MBB of the function.
44   void initGlobalBaseReg(MachineFunction &MF);
45
46   void initMips16SPAliasReg(MachineFunction &MF);
47 };
48
49 FunctionPass *createMips16ISelDag(MipsTargetMachine &TM);
50
51 }
52
53 #endif