LLVM API Documentation
00001 //===-- IA64ISelLowering.h - IA64 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 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, 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 public: 00045 explicit IA64TargetLowering(TargetMachine &TM); 00046 00047 unsigned VirtGPR; // this is public so it can be accessed in the selector 00048 // for ISD::RET. add an accessor instead? FIXME 00049 const char *getTargetNodeName(unsigned Opcode) const; 00050 00051 /// getSetCCResultType: return ISD::SETCC's result type. 00052 virtual MVT getSetCCResultType(MVT VT) const; 00053 00054 /// LowerArguments - This hook must be implemented to indicate how we should 00055 /// lower the arguments for the specified function, into the specified DAG. 00056 virtual void LowerArguments(Function &F, SelectionDAG &DAG, 00057 SmallVectorImpl<SDValue> &ArgValues, 00058 DebugLoc dl); 00059 00060 /// LowerCallTo - This hook lowers an abstract call to a function into an 00061 /// actual call. 00062 virtual std::pair<SDValue, SDValue> 00063 LowerCallTo(SDValue Chain, const Type *RetTy, 00064 bool RetSExt, bool RetZExt, bool isVarArg, bool isInreg, 00065 unsigned CC, bool isTailCall, 00066 SDValue Callee, ArgListTy &Args, SelectionDAG &DAG, 00067 DebugLoc dl); 00068 00069 /// LowerOperation - for custom lowering specific ops 00070 /// (currently, only "ret void") 00071 virtual SDValue LowerOperation(SDValue Op, SelectionDAG &DAG); 00072 00073 }; 00074 } 00075 00076 #endif // LLVM_TARGET_IA64_IA64ISELLOWERING_H