This pass is a port of the according pass from the HSAIL compiler.
It parses printf calls and setup runtime printf buffer.
After that it copies printf arguments to the buffer and fills in
module metadata for runtime.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/Target/AMDGPU/AMDGPUPrinfRuntimeBinding.cpp | ||
---|---|---|
347 ↗ | (On Diff #69711) | This one as well as "transPrintfVectorFormat" is only relevant to cpu device as a target. |
lib/Target/AMDGPU/AMDGPUPrinfRuntimeBinding.cpp | ||
---|---|---|
347 ↗ | (On Diff #69711) | We can't have X86 code in the AMDGPU backend, so these functions should be removed. |
Hi, MSan is complaining about this change:
28574==WARNING: MemorySanitizer: use-of-uninitialized-value
#0 0x130075d in (anonymous namespace)::AMDGPUPrintfRuntimeBinding::lowerPrintfForGpu(llvm::Module&) /b/sanitizer-x86_64-linux-fast/build/llvm/lib/Target/AMDGPU/AMDGPUPrintfRuntimeBinding.cpp:576:39 #1 0x12f8287 in (anonymous namespace)::AMDGPUPrintfRuntimeBinding::runOnModule(llvm::Module&) /b/sanitizer-x86_64-linux-fast/build/llvm/lib/Target/AMDGPU/AMDGPUPrintfRuntimeBinding.cpp:613:10 #2 0x544a96d in runOnModule /b/sanitizer-x86_64-linux-fast/build/llvm/lib/IR/LegacyPassManager.cpp:1750:27 #3 0x544a96d in llvm::legacy::PassManagerImpl::run(llvm::Module&) /b/sanitizer-x86_64-linux-fast/build/llvm/lib/IR/LegacyPassManager.cpp:1863 #4 0x9e58b7 in main /b/sanitizer-x86_64-linux-fast/build/llvm/tools/opt/opt.cpp:892:12 #5 0x7f84fa91f2e0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202e0) #6 0x91ce99 in _start (/b/sanitizer-x86_64-linux-fast/build/llvm_build_msan/bin/opt+0x91ce99)
Hm... Is it only me, but msan has zillions of failures everywhere, starting with tablegen?
It's a bit hard to use, you need to build libcxx/libcxxabi with msan as well.
See here:
https://github.com/google/sanitizers/wiki/MemorySanitizerBootstrappingClang
I've started a build with track-origins here:
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap-msan/builds/14114
It could give more information.
This is really complicated, I did not manage to do it in a short time. However, what was written on that line did not make any sense to me anyway.
Hence the change changing the loop, its iterator and the whole offended line: rL368645
I believe it should fix the issue.