LLVM API Documentation

IA64ISelLowering.h

Go to the documentation of this file.
00001 //===-- IA64ISelLowering.h - IA64 DAG Lowering Interface --------*- C++ -*-===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file was developed by Duraid Madina and is distributed under
00006 // the University of Illinois Open Source License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // This file defines the interfaces that IA64 uses to lower LLVM code into a
00011 // selection DAG.
00012 //
00013 //===----------------------------------------------------------------------===//
00014 
00015 #ifndef LLVM_TARGET_IA64_IA64ISELLOWERING_H
00016 #define LLVM_TARGET_IA64_IA64ISELLOWERING_H
00017 
00018 #include "llvm/Target/TargetLowering.h"
00019 #include "llvm/CodeGen/SelectionDAG.h"
00020 #include "IA64.h"
00021 
00022 namespace llvm {
00023   namespace IA64ISD {
00024     enum NodeType {
00025       // Start the numbering where the builting ops and target ops leave off.
00026       FIRST_NUMBER = ISD::BUILTIN_OP_END+IA64::INSTRUCTION_LIST_END,
00027 
00028       /// GETFD - the getf.d instruction takes a floating point operand and
00029       /// returns its 64-bit memory representation as an i64
00030       GETFD,
00031 
00032       // TODO: explain this hack
00033       BRCALL,
00034       
00035       // RET_FLAG - Return with a flag operand
00036       RET_FLAG
00037     };
00038   }  
00039   
00040   class IA64TargetLowering : public TargetLowering {
00041     int VarArgsFrameIndex;            // FrameIndex for start of varargs area.
00042     //int ReturnAddrIndex;              // FrameIndex for return slot.
00043     unsigned GP, SP, RP; // FIXME - clean this mess up
00044     
00045   public:
00046     IA64TargetLowering(TargetMachine &TM);
00047 
00048     unsigned VirtGPR; // this is public so it can be accessed in the selector
00049                       // for ISD::RET. add an accessor instead? FIXME
00050       
00051     const char *getTargetNodeName(unsigned Opcode) const;
00052       
00053     /// LowerArguments - This hook must be implemented to indicate how we should
00054     /// lower the arguments for the specified function, into the specified DAG.
00055     virtual std::vector<SDOperand>
00056       LowerArguments(Function &F, SelectionDAG &DAG);
00057     
00058     /// LowerCallTo - This hook lowers an abstract call to a function into an
00059     /// actual call.
00060     virtual std::pair<SDOperand, SDOperand>
00061       LowerCallTo(SDOperand Chain, const Type *RetTy, bool isVarArg,
00062                   unsigned CC,
00063                   bool isTailCall, SDOperand Callee, ArgListTy &Args,
00064                   SelectionDAG &DAG);
00065     
00066     /// LowerOperation - for custom lowering specific ops
00067     /// (currently, only "ret void")
00068     virtual SDOperand LowerOperation(SDOperand Op, SelectionDAG &DAG);
00069     
00070     virtual std::pair<SDOperand, SDOperand>
00071       LowerFrameReturnAddress(bool isFrameAddr, SDOperand Chain, unsigned Depth,
00072                               SelectionDAG &DAG);
00073     
00074 // XXX    virtual MachineBasicBlock *InsertAtEndOfBasicBlock(MachineInstr *MI,
00075 // XXX                                                      MachineBasicBlock *MBB);
00076   };
00077 }
00078 
00079 #endif   // LLVM_TARGET_IA64_IA64ISELLOWERING_H