LLVM API Documentation

Mips16ISelDAGToDAG.h
Go to the documentation of this file.
00001 //===---- Mips16ISelDAGToDAG.h - A Dag to Dag Inst Selector for Mips ------===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // Subclass of MipsDAGToDAGISel specialized for mips16.
00011 //
00012 //===----------------------------------------------------------------------===//
00013 
00014 #ifndef LLVM_LIB_TARGET_MIPS_MIPS16ISELDAGTODAG_H
00015 #define LLVM_LIB_TARGET_MIPS_MIPS16ISELDAGTODAG_H
00016 
00017 #include "MipsISelDAGToDAG.h"
00018 
00019 namespace llvm {
00020 
00021 class Mips16DAGToDAGISel : public MipsDAGToDAGISel {
00022 public:
00023   explicit Mips16DAGToDAGISel(MipsTargetMachine &TM) : MipsDAGToDAGISel(TM) {}
00024 
00025 private:
00026   std::pair<SDNode*, SDNode*> selectMULT(SDNode *N, unsigned Opc, SDLoc DL,
00027                                          EVT Ty, bool HasLo, bool HasHi);
00028 
00029   SDValue getMips16SPAliasReg();
00030 
00031   bool runOnMachineFunction(MachineFunction &MF) override;
00032 
00033   void getMips16SPRefReg(SDNode *Parent, SDValue &AliasReg);
00034 
00035   bool selectAddr16(SDNode *Parent, SDValue N, SDValue &Base,
00036                     SDValue &Offset, SDValue &Alias) override;
00037 
00038   std::pair<bool, SDNode*> selectNode(SDNode *Node) override;
00039 
00040   void processFunctionAfterISel(MachineFunction &MF) override;
00041 
00042   // Insert instructions to initialize the global base register in the
00043   // first MBB of the function.
00044   void initGlobalBaseReg(MachineFunction &MF);
00045 
00046   void initMips16SPAliasReg(MachineFunction &MF);
00047 };
00048 
00049 FunctionPass *createMips16ISelDag(MipsTargetMachine &TM);
00050 
00051 }
00052 
00053 #endif