This patch introduces the flags -fopenmp-target-debug and
-fopenmp-target-debug= to set the value of a global in the device.
This will be used to enable or disable debugging features statically in
the device runtime library.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Time | Test | |
---|---|---|
200 ms | x64 windows > Clang.OpenMP::target_debug_codegen.cpp |
Event Timeline
clang/lib/Frontend/CompilerInvocation.cpp | ||
---|---|---|
3900 | CUDANumSMs? Don't check for NVPTX/AMDGCN but only if the new runtime is used, if not emit a warning that the flag is useless and ignored without the new runtime. | |
llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp | ||
254 | Linkage cannot be private, I think. It might be ok if we put it in the llvm.used global otherwise we should just make it external, which is probably best. |
Adding constant to llvm.used. This is most likely easier than dealing with weak external linkage.
This change causes clang-ast-dump to segfault for me while building clang:
[399/399] ASTNodeAPI.json FAILED: tools/clang/lib/Tooling/ASTNodeAPI.json /home/mgorny/git/llvm-project/build/tools/clang/lib/Tooling/ASTNodeAPI.json cd /home/mgorny/git/llvm-project/build/tools/clang/lib/Tooling && /home/mgorny/git/llvm-project/build/bin/clang-ast-dump --skip-processing=0 -I /home/mgorny/git/llvm-project/build/lib/clang/14.0.0/include -I /home/mgorny/git/llvm-project/llvm/../clang/include -I /home/mgorny/git/llvm-project/build/tools/clang/include -I /home/mgorny/git/llvm-project/build/include -I /home/mgorny/git/llvm-project/llvm/include -I /usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/include/g++-v11 -I /usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/include/g++-v11/x86_64-pc-linux-gnu -I /usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/include/g++-v11/backward -I /usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/include -I /usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/include-fixed -I /usr/include --json-output-path /home/mgorny/git/llvm-project/build/tools/clang/lib/Tooling/ASTNodeAPI.json ninja: build stopped: subcommand failed.
Reading symbols from /home/mgorny/git/llvm-project/build/bin/clang-ast-dump... [New LWP 230743] [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". Core was generated by `/home/mgorny/git/llvm-project/build/bin/clang-ast-dump --skip-processing=0 -I /'. Program terminated with signal SIGSEGV, Segmentation fault. #0 0x00007ff222268a87 in llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul, 128ul>::~BumpPtrAllocatorImpl() () from /home/mgorny/git/llvm-project/build/bin/../lib/../lib/libclangLex.so.14git (gdb) bt #0 0x00007ff222268a87 in llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul, 128ul>::~BumpPtrAllocatorImpl() () from /home/mgorny/git/llvm-project/build/bin/../lib/../lib/libclangLex.so.14git #1 0x00007ff2222a1404 in clang::HeaderSearch::~HeaderSearch() () from /home/mgorny/git/llvm-project/build/bin/../lib/../lib/libclangLex.so.14git #2 0x00007ff2222a1859 in clang::Preprocessor::~Preprocessor() () from /home/mgorny/git/llvm-project/build/bin/../lib/../lib/libclangLex.so.14git #3 0x00007ff224d3175c in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() () from /home/mgorny/git/llvm-project/build/bin/../lib/libclangFrontend.so.14git #4 0x00007ff224d4c801 in clang::CompilerInstance::~CompilerInstance() () from /home/mgorny/git/llvm-project/build/bin/../lib/libclangFrontend.so.14git #5 0x0000556c688f8a95 in main ()
I'm going to try RelWithDebInfo build but I'm afraid I don't have sufficient free space for that.
I'm sorry, it seems to have been caused by ccache. After clearing the cache, I can't reproduce anymore.
The problem is that clang-ast-dump has incomplete dependences and sometimes picks stuff up from the install folder.
If you delete install it works, ccache might have a similar effect.
clang-format: please reformat the code