This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU/SI: Don't emit group segment global variables
ClosedPublic

Authored by tstellarAMD on Dec 1 2015, 7:47 AM.

Details

Summary

Only global or readonly segment variables should appear in object files.

Diff Detail

Event Timeline

tstellarAMD retitled this revision from to AMDGPU/SI: Don't emit group segment global variables.
tstellarAMD updated this object.
tstellarAMD added a reviewer: arsenm.
tstellarAMD added a subscriber: llvm-commits.
arsenm added inline comments.Dec 1 2015, 9:51 AM
lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
129

I think you can get the Triple from the TargetMachine and don't have to construct one here

Get Triple from Targetmachine.

tstellarAMD marked an inline comment as done.Dec 1 2015, 2:15 PM
arsenm accepted this revision.Dec 1 2015, 3:09 PM
arsenm edited edge metadata.

LGTM

This revision is now accepted and ready to land.Dec 1 2015, 3:09 PM
This revision was automatically updated to reflect the committed changes.

I'm not yet sure how, but it seems that this change broke a build:

http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/8259/steps/check-llvm%20msan/logs/stdio

29897==WARNING: MemorySanitizer: use-of-uninitialized-value

#0 0x4396b49 in llvm::raw_ostream::operator<<(unsigned long) /mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/lib/Support/raw_ostream.cpp:110:7
#1 0xe2f586 in llvm::AMDGPUTargetAsmStreamer::EmitAMDKernelCodeT(amd_kernel_code_s const&) /mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.cpp:187:40
#2 0xbbedbb in llvm::AMDGPUAsmPrinter::EmitAmdKernelCodeT(llvm::MachineFunction const&, llvm::AMDGPUAsmPrinter::SIProgramInfo const&) const /mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp:596:3
#3 0xbbca50 in llvm::AMDGPUAsmPrinter::EmitFunctionBodyStart() /mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp:99:5
#4 0x29bf8fb in llvm::AsmPrinter::EmitFunctionBody() /mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp:875:3
#5 0xbc0400 in llvm::AMDGPUAsmPrinter::runOnMachineFunction(llvm::MachineFunction&) /mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp:167:3
#6 0x2db7343 in llvm::MachineFunctionPass::runOnFunction(llvm::Function&) /mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/lib/CodeGen/MachineFunctionPass.cpp:43:10
#7 0x36c4bff in llvm::FPPassManager::runOnFunction(llvm::Function&) /mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/lib/IR/LegacyPassManager.cpp:1521:23
#8 0x36c5297 in llvm::FPPassManager::runOnModule(llvm::Module&) /mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/lib/IR/LegacyPassManager.cpp:1542:16
#9 0x36c65d8 in runOnModule /mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/lib/IR/LegacyPassManager.cpp:1598:23
#10 0x36c65d8 in llvm::legacy::PassManagerImpl::run(llvm::Module&) /mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/lib/IR/LegacyPassManager.cpp:1701
#11 0x6a09af in compileModule /mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/tools/llc/llc.cpp:381:5
#12 0x6a09af in main /mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/tools/llc/llc.cpp:204
#13 0x7ffb1bd0aec4 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21ec4)
#14 0x60dd83 in _start (/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm_build_msan/bin/llc+0x60dd83)