[AMDGPU] Fix compilation failure when IR contains comdat
authorYaxun Liu <Yaxun.Liu@amd.com>
Fri, 11 May 2018 20:40:14 +0000 (20:40 +0000)
committerYaxun Liu <Yaxun.Liu@amd.com>
Fri, 11 May 2018 20:40:14 +0000 (20:40 +0000)
commitdeba150c2750717bc3c83877f74099c8578e8f30
tree5c697767cf71ad6b11b0c91f2a93fb6f07b06368
parent3ee2a6bd5c8c8cefa84c8145b8e2310f202bc3db
[AMDGPU] Fix compilation failure when IR contains comdat

Remove a useless SwitchSection which also causes compilation failure
when IR contains comdat.

The SwitchSection is useless because the current section is already
correct text section for the function therefore no need to switch.

It causes compilation failure for comdat because functions with comdat
has specific text section, not the default .text section.

Since HIP uses comdat, this bug caused failures for HIP.

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

llvm-svn: 332137
llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
llvm/test/CodeGen/AMDGPU/comdat.ll [new file with mode: 0644]