Eric Christopher | 50880d0 | 2010-09-18 18:52:28 +0000 | [diff] [blame^] | 1 | //===-- PTXISelLowering.cpp - PTX DAG Lowering Implementation -------------===// |
| 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 | // This file implements the PTXTargetLowering class. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #include "PTXISelLowering.h" |
| 15 | #include "PTXRegisterInfo.h" |
| 16 | #include "llvm/Support/ErrorHandling.h" |
| 17 | #include "llvm/CodeGen/SelectionDAG.h" |
| 18 | #include "llvm/CodeGen/TargetLoweringObjectFileImpl.h" |
| 19 | |
| 20 | using namespace llvm; |
| 21 | |
| 22 | PTXTargetLowering::PTXTargetLowering(TargetMachine &TM) |
| 23 | : TargetLowering(TM, new TargetLoweringObjectFileELF()) { |
| 24 | // Set up the register classes. |
| 25 | addRegisterClass(MVT::i1, PTX::PredsRegisterClass); |
| 26 | |
| 27 | // Compute derived properties from the register classes |
| 28 | computeRegisterProperties(); |
| 29 | } |
| 30 | |
| 31 | const char *PTXTargetLowering::getTargetNodeName(unsigned Opcode) const { |
| 32 | switch (Opcode) { |
| 33 | default: llvm_unreachable("Unknown opcode"); |
| 34 | case PTXISD::EXIT: return "PTXISD::EXIT"; |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | //===----------------------------------------------------------------------===// |
| 39 | // Calling Convention Implementation |
| 40 | //===----------------------------------------------------------------------===// |
| 41 | |
| 42 | SDValue PTXTargetLowering:: |
| 43 | LowerFormalArguments(SDValue Chain, |
| 44 | CallingConv::ID CallConv, |
| 45 | bool isVarArg, |
| 46 | const SmallVectorImpl<ISD::InputArg> &Ins, |
| 47 | DebugLoc dl, |
| 48 | SelectionDAG &DAG, |
| 49 | SmallVectorImpl<SDValue> &InVals) const { |
| 50 | return Chain; |
| 51 | } |
| 52 | |
| 53 | SDValue PTXTargetLowering:: |
| 54 | LowerReturn(SDValue Chain, |
| 55 | CallingConv::ID CallConv, |
| 56 | bool isVarArg, |
| 57 | const SmallVectorImpl<ISD::OutputArg> &Outs, |
| 58 | const SmallVectorImpl<SDValue> &OutVals, |
| 59 | DebugLoc dl, |
| 60 | SelectionDAG &DAG) const { |
| 61 | return DAG.getNode(PTXISD::EXIT, dl, MVT::Other, Chain); |
| 62 | } |