From ca9215970d3a7fb9450d4ad1c22a2418f686a1a4 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Wed, 28 Sep 2011 04:32:36 +0000 Subject: PTX: Simplify code. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140680 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/PTX/PTXISelLowering.cpp | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'lib') diff --git a/lib/Target/PTX/PTXISelLowering.cpp b/lib/Target/PTX/PTXISelLowering.cpp index 44733ac491..c439d4c173 100644 --- a/lib/Target/PTX/PTXISelLowering.cpp +++ b/lib/Target/PTX/PTXISelLowering.cpp @@ -399,19 +399,11 @@ PTXTargetLowering::LowerCall(SDValue Chain, SDValue Callee, Ops[0] = Chain; // Identify the callee function - if (GlobalAddressSDNode *G = dyn_cast(Callee)) { - const GlobalValue *GV = G->getGlobal(); - if (const Function *F = dyn_cast(GV)) { - assert(F->getCallingConv() == CallingConv::PTX_Device && - "PTX function calls must be to PTX device functions"); - Callee = DAG.getTargetGlobalAddress(GV, dl, getPointerTy()); - Ops[Ins.size()+1] = Callee; - } else { - assert(false && "GlobalValue is not a function"); - } - } else { - assert(false && "Function must be a GlobalAddressSDNode"); - } + const GlobalValue *GV = cast(Callee)->getGlobal(); + assert(cast(GV)->getCallingConv() == CallingConv::PTX_Device && + "PTX function calls must be to PTX device functions"); + Callee = DAG.getTargetGlobalAddress(GV, dl, getPointerTy()); + Ops[Ins.size()+1] = Callee; // Generate STORE_PARAM nodes for each function argument. In PTX, function // arguments are explicitly stored into .param variables and passed as -- cgit v1.2.3