[llvm] r265408 - [AMDGPU] Emit linkonce and linkonce_odr symbols
Konstantin Zhuravlyov via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 5 09:01:01 PDT 2016
Author: kzhuravl
Date: Tue Apr 5 11:00:58 2016
New Revision: 265408
URL: http://llvm.org/viewvc/llvm-project?rev=265408&view=rev
Log:
[AMDGPU] Emit linkonce and linkonce_odr symbols
Differential Revision: http://reviews.llvm.org/D18726
Modified:
llvm/trunk/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
llvm/trunk/test/CodeGen/AMDGPU/hsa-globals.ll
Modified: llvm/trunk/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp?rev=265408&r1=265407&r2=265408&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp Tue Apr 5 11:00:58 2016
@@ -134,6 +134,8 @@ void AMDGPUAsmPrinter::EmitFunctionEntry
static bool isModuleLinkage(const GlobalValue *GV) {
switch (GV->getLinkage()) {
+ case GlobalValue::LinkOnceODRLinkage:
+ case GlobalValue::LinkOnceAnyLinkage:
case GlobalValue::InternalLinkage:
case GlobalValue::CommonLinkage:
return true;
Modified: llvm/trunk/test/CodeGen/AMDGPU/hsa-globals.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AMDGPU/hsa-globals.ll?rev=265408&r1=265407&r2=265408&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/AMDGPU/hsa-globals.ll (original)
+++ llvm/trunk/test/CodeGen/AMDGPU/hsa-globals.ll Tue Apr 5 11:00:58 2016
@@ -1,10 +1,14 @@
; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=kaveri | FileCheck --check-prefix=ASM %s
; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=kaveri | llvm-mc -filetype=obj -triple amdgcn--amdhsa -mcpu=kaveri | llvm-readobj -symbols -s | FileCheck %s --check-prefix=ELF
+ at linkonce_odr_global_program = linkonce_odr addrspace(1) global i32 0
+ at linkonce_global_program = linkonce addrspace(1) global i32 0
@internal_global_program = internal addrspace(1) global i32 0
@common_global_program = common addrspace(1) global i32 0
@external_global_program = addrspace(1) global i32 0
+ at linkonce_odr_global_agent = linkonce_odr addrspace(1) global i32 0, section ".hsadata_global_agent"
+ at linkonce_global_agent = linkonce addrspace(1) global i32 0, section ".hsadata_global_agent"
@internal_global_agent = internal addrspace(1) global i32 0, section ".hsadata_global_agent"
@common_global_agent = common addrspace(1) global i32 0, section ".hsadata_global_agent"
@external_global_agent = addrspace(1) global i32 0, section ".hsadata_global_agent"
@@ -16,6 +20,18 @@ define void @test() {
ret void
}
+; ASM: .amdgpu_hsa_module_global linkonce_odr_global
+; ASM: .size linkonce_odr_global_program, 4
+; ASM: .hsadata_global_program
+; ASM: linkonce_odr_global_program:
+; ASM: .long 0
+
+; ASM: .amdgpu_hsa_module_global linkonce_global
+; ASM: .size linkonce_global_program, 4
+; ASM: .hsadata_global_program
+; ASM: linkonce_global_program:
+; ASM: .long 0
+
; ASM: .amdgpu_hsa_module_global internal_global
; ASM: .size internal_global_program, 4
; ASM: .hsadata_global_program
@@ -34,6 +50,18 @@ define void @test() {
; ASM: external_global_program:
; ASM: .long 0
+; ASM: .amdgpu_hsa_module_global linkonce_odr_global
+; ASM: .size linkonce_odr_global_agent, 4
+; ASM: .hsadata_global_agent
+; ASM: linkonce_odr_global_agent:
+; ASM: .long 0
+
+; ASM: .amdgpu_hsa_module_global linkonce_global
+; ASM: .size linkonce_global_agent, 4
+; ASM: .hsadata_global_agent
+; ASM: linkonce_global_agent:
+; ASM: .long 0
+
; ASM: .amdgpu_hsa_module_global internal_global
; ASM: .size internal_global_agent, 4
; ASM: .hsadata_global_agent
@@ -124,6 +152,34 @@ define void @test() {
; ELF: }
; ELF: Symbol {
+; ELF: Name: linkonce_global_agent
+; ELF: Size: 4
+; ELF: Binding: Local
+; ELF: Section: .hsadata_global_agent
+; ELF: }
+
+; ELF: Symbol {
+; ELF: Name: linkonce_global_program
+; ELF: Size: 4
+; ELF: Binding: Local
+; ELF: Section: .hsadata_global_program
+; ELF: }
+
+; ELF: Symbol {
+; ELF: Name: linkonce_odr_global_agent
+; ELF: Size: 4
+; ELF: Binding: Local
+; ELF: Section: .hsadata_global_agent
+; ELF: }
+
+; ELF: Symbol {
+; ELF: Name: linkonce_odr_global_program
+; ELF: Size: 4
+; ELF: Binding: Local
+; ELF: Section: .hsadata_global_program
+; ELF: }
+
+; ELF: Symbol {
; ELF: Name: external_global_agent
; ELF: Size: 4
; ELF: Binding: Global
More information about the llvm-commits
mailing list