LLVM API Documentation

BlackfinISelLowering.h

Go to the documentation of this file.
00001 //===- BlackfinISelLowering.h - Blackfin DAG Lowering Interface -*- C++ -*-===//
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 // This file defines the interfaces that Blackfin uses to lower LLVM code into a
00011 // selection DAG.
00012 //
00013 //===----------------------------------------------------------------------===//
00014 
00015 #ifndef BLACKFIN_ISELLOWERING_H
00016 #define BLACKFIN_ISELLOWERING_H
00017 
00018 #include "llvm/Target/TargetLowering.h"
00019 #include "Blackfin.h"
00020 
00021 namespace llvm {
00022 
00023   namespace BFISD {
00024     enum {
00025       FIRST_NUMBER = ISD::BUILTIN_OP_END,
00026       CALL,                     // A call instruction.
00027       RET_FLAG,                 // Return with a flag operand.
00028       Wrapper                   // Address wrapper
00029     };
00030   }
00031 
00032   class BlackfinTargetLowering : public TargetLowering {
00033     int VarArgsFrameOffset;   // Frame offset to start of varargs area.
00034   public:
00035     BlackfinTargetLowering(TargetMachine &TM);
00036     virtual MVT::SimpleValueType getSetCCResultType(EVT VT) const;
00037     virtual SDValue LowerOperation(SDValue Op, SelectionDAG &DAG);
00038     virtual void ReplaceNodeResults(SDNode *N,
00039                                     SmallVectorImpl<SDValue> &Results,
00040                                     SelectionDAG &DAG);
00041 
00042     int getVarArgsFrameOffset() const { return VarArgsFrameOffset; }
00043 
00044     ConstraintType getConstraintType(const std::string &Constraint) const;
00045     std::pair<unsigned, const TargetRegisterClass*>
00046     getRegForInlineAsmConstraint(const std::string &Constraint, EVT VT) const;
00047     std::vector<unsigned>
00048     getRegClassForInlineAsmConstraint(const std::string &Constraint,
00049                                       EVT VT) const;
00050     virtual bool isOffsetFoldingLegal(const GlobalAddressSDNode *GA) const;
00051     const char *getTargetNodeName(unsigned Opcode) const;
00052     unsigned getFunctionAlignment(const Function *F) const;
00053 
00054   private:
00055     SDValue LowerGlobalAddress(SDValue Op, SelectionDAG &DAG);
00056     SDValue LowerJumpTable(SDValue Op, SelectionDAG &DAG);
00057     SDValue LowerADDE(SDValue Op, SelectionDAG &DAG);
00058 
00059     virtual SDValue
00060       LowerFormalArguments(SDValue Chain,
00061                            unsigned CallConv, bool isVarArg,
00062                            const SmallVectorImpl<ISD::InputArg> &Ins,
00063                            DebugLoc dl, SelectionDAG &DAG,
00064                            SmallVectorImpl<SDValue> &InVals);
00065     virtual SDValue
00066       LowerCall(SDValue Chain, SDValue Callee,
00067                 unsigned CallConv, bool isVarArg, bool isTailCall,
00068                 const SmallVectorImpl<ISD::OutputArg> &Outs,
00069                 const SmallVectorImpl<ISD::InputArg> &Ins,
00070                 DebugLoc dl, SelectionDAG &DAG,
00071                 SmallVectorImpl<SDValue> &InVals);
00072 
00073     virtual SDValue
00074       LowerReturn(SDValue Chain,
00075                   unsigned CallConv, bool isVarArg,
00076                   const SmallVectorImpl<ISD::OutputArg> &Outs,
00077                   DebugLoc dl, SelectionDAG &DAG);
00078   };
00079 } // end namespace llvm
00080 
00081 #endif    // BLACKFIN_ISELLOWERING_H