PTX: Simplify code. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140680 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Benjamin Kramer 2011-09-28 04:32:36 +00:00
parent 8adae0c940
commit ca9215970d

View File

@ -399,19 +399,11 @@ PTXTargetLowering::LowerCall(SDValue Chain, SDValue Callee,
Ops[0] = Chain; Ops[0] = Chain;
// Identify the callee function // Identify the callee function
if (GlobalAddressSDNode *G = dyn_cast<GlobalAddressSDNode>(Callee)) { const GlobalValue *GV = cast<GlobalAddressSDNode>(Callee)->getGlobal();
const GlobalValue *GV = G->getGlobal(); assert(cast<Function>(GV)->getCallingConv() == CallingConv::PTX_Device &&
if (const Function *F = dyn_cast<Function>(GV)) { "PTX function calls must be to PTX device functions");
assert(F->getCallingConv() == CallingConv::PTX_Device && Callee = DAG.getTargetGlobalAddress(GV, dl, getPointerTy());
"PTX function calls must be to PTX device functions"); Ops[Ins.size()+1] = Callee;
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");
}
// Generate STORE_PARAM nodes for each function argument. In PTX, function // Generate STORE_PARAM nodes for each function argument. In PTX, function
// arguments are explicitly stored into .param variables and passed as // arguments are explicitly stored into .param variables and passed as