diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2018-04-23 17:33:41 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2018-04-23 17:33:41 +0000 |
commit | 2091ca6c977097bdbbd5c377b357a9bc85b1a489 (patch) | |
tree | a82d48c27506252fb67ad5b55ddbf196eb1e88aa /clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp | |
parent | 061fcd586d30fc0ea15233763ef892558013c119 (diff) | |
download | bcm5719-llvm-2091ca6c977097bdbbd5c377b357a9bc85b1a489.tar.gz bcm5719-llvm-2091ca6c977097bdbbd5c377b357a9bc85b1a489.zip |
[OPENMP] Do not cast captured by value variables with pointer types in
NVPTX target.
When generating the wrapper function for the offloading region, we need
to call the outlined function and cast the arguments correctly to follow
the ABI. Usually, variables captured by value are casted to `uintptr_t`
type. But this should not performed for the variables with pointer type.
llvm-svn: 330620
Diffstat (limited to 'clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp b/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp index 7abe2d741a8..59858d34304 100644 --- a/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp +++ b/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp @@ -3037,7 +3037,8 @@ llvm::Function *CGOpenMPRuntimeNVPTX::createParallelDataSharingWrapper( /*Volatile=*/false, CGFContext.getPointerType(ElemTy), CI->getLocation()); - if (CI->capturesVariableByCopy()) { + if (CI->capturesVariableByCopy() && + !CI->getCapturedVar()->getType()->isAnyPointerType()) { Arg = castValueToType(CGF, Arg, ElemTy, CGFContext.getUIntPtrType(), CI->getLocation()); } |