Commit Graph

4 Commits

Author SHA1 Message Date
Yaxun Liu a25e503459 Recommit r326946 after reducing CallArgList memory footprint
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@327634 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-15 15:25:19 +00:00
Richard Smith 5034f5fdda Revert r326946. It caused stack overflows by significantly increasing the size of a CallArgList.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@327195 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-10 01:47:22 +00:00
Yaxun Liu 8e23619931 CodeGen: Fix address space of indirect function argument
The indirect function argument is in alloca address space in LLVM IR. However,
during Clang codegen for C++, the address space of indirect function argument
should match its address space in the source code, i.e., default addr space, even
for indirect argument. This is because destructor of the indirect argument may
be called in the caller function, and address of the indirect argument may be
taken, in either case the indirect function argument is expected to be in default
addr space, not the alloca address space.

Therefore, the indirect function argument should be mapped to the temp var
casted to default address space. The caller will cast it to alloca addr space
when passing it to the callee. In the callee, the argument is also casted to the
default address space and used.

CallArg is refactored to facilitate this fix.

Differential Revision: https://reviews.llvm.org/D34367


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@326946 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-07 21:45:40 +00:00
Arpith Chacko Jacob d3d136e37c [OpenMP][NVPTX][CUDA] Adding support for printf for an NVPTX OpenMP device.
Support for CUDA printf is exploited to support printf for
an NVPTX OpenMP device.

To reflect the support of both programming models, the file
CGCUDABuiltin.cpp has been renamed to CGGPUBuiltin.cpp, and
the call EmitCUDADevicePrintfCallExpr has been renamed to
EmitGPUDevicePrintfCallExpr.

Reviewers: jlebar
Differential Revision: https://reviews.llvm.org/D17890


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@293444 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-29 20:49:31 +00:00