From d3e170c4388693b6628fa91cbf78506a5fb45439 Mon Sep 17 00:00:00 2001 From: Mark Searles Date: Fri, 21 Feb 2020 15:26:51 -0800 Subject: [PATCH] =?utf8?q?Revert=20"[AMDGPU]=20Don=E2=80=99t=20marke=20the?= =?utf8?q?=20.note=20section=20as=20ALLOC"?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This reverts commit 977cd661cf019039dec7ffdd15bf0ac500828c87. It breaks OpenCL testing. OpenCL Runtime is using PT_LOAD information to calculate memory for global variables. This commit should be relanded once the OpenCL runtime stops relying on PT_LOAD information for calculating global variable memory size. Differential Revision: https://reviews.llvm.org/D74995 --- llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.cpp | 2 +- llvm/test/CodeGen/AMDGPU/hsa.ll | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.cpp b/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.cpp index 3c52de9..c7ccd0a 100644 --- a/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.cpp +++ b/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.cpp @@ -440,7 +440,7 @@ void AMDGPUTargetELFStreamer::EmitNote( S.PushSection(); S.SwitchSection(Context.getELFSection( - ElfNote::SectionName, ELF::SHT_NOTE, 0)); + ElfNote::SectionName, ELF::SHT_NOTE, ELF::SHF_ALLOC)); S.emitIntValue(NameSZ, 4); // namesz S.emitValue(DescSZ, 4); // descz S.emitIntValue(NoteType, 4); // type diff --git a/llvm/test/CodeGen/AMDGPU/hsa.ll b/llvm/test/CodeGen/AMDGPU/hsa.ll index c78239e..3462398 100644 --- a/llvm/test/CodeGen/AMDGPU/hsa.ll +++ b/llvm/test/CodeGen/AMDGPU/hsa.ll @@ -19,7 +19,8 @@ ; ELF: } ; ELF: SHT_NOTE -; ELF: Flags [ (0x0) +; ELF: Flags [ (0x2) +; ELF: SHF_ALLOC (0x2) ; ELF: ] ; ELF: SectionData ( ; ELF: 0000: 04000000 08000000 01000000 414D4400 -- 2.7.4