1 //===-- PTXISelLowering.cpp - PTX DAG Lowering Implementation -------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file implements the PTXTargetLowering class.
12 //===----------------------------------------------------------------------===//
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"
22 PTXTargetLowering::PTXTargetLowering(TargetMachine &TM)
23 : TargetLowering(TM, new TargetLoweringObjectFileELF()) {
24 // Set up the register classes.
25 addRegisterClass(MVT::i1, PTX::PredsRegisterClass);
27 // Compute derived properties from the register classes
28 computeRegisterProperties();
31 const char *PTXTargetLowering::getTargetNodeName(unsigned Opcode) const {
33 default: llvm_unreachable("Unknown opcode");
34 case PTXISD::EXIT: return "PTXISD::EXIT";
38 //===----------------------------------------------------------------------===//
39 // Calling Convention Implementation
40 //===----------------------------------------------------------------------===//
42 SDValue PTXTargetLowering::
43 LowerFormalArguments(SDValue Chain,
44 CallingConv::ID CallConv,
46 const SmallVectorImpl<ISD::InputArg> &Ins,
49 SmallVectorImpl<SDValue> &InVals) const {
53 SDValue PTXTargetLowering::
54 LowerReturn(SDValue Chain,
55 CallingConv::ID CallConv,
57 const SmallVectorImpl<ISD::OutputArg> &Outs,
58 const SmallVectorImpl<SDValue> &OutVals,
60 SelectionDAG &DAG) const {
61 return DAG.getNode(PTXISD::EXIT, dl, MVT::Other, Chain);