[PATCH] D130245: [XCOFF] disable location attribute generation for TLS variable

ChenZheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 11 21:55:25 PDT 2022


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
shchenz marked an inline comment as done.
Closed by commit rG8d19cfb72e13: [PowerPC] omit location attribute for TLS variable on AIX (authored by shchenz).

Changed prior to commit:
  https://reviews.llvm.org/D130245?vs=446419&id=452076#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D130245/new/

https://reviews.llvm.org/D130245

Files:
  llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
  llvm/test/CodeGen/PowerPC/tls-debug-aix.ll


Index: llvm/test/CodeGen/PowerPC/tls-debug-aix.ll
===================================================================
--- /dev/null
+++ llvm/test/CodeGen/PowerPC/tls-debug-aix.ll
@@ -0,0 +1,54 @@
+; RUN: llc -mtriple powerpc-ibm-aix-xcoff < %s | FileCheck %s --check-prefix=ASM
+; RUN: llc -mtriple powerpc64-ibm-aix-xcoff < %s | FileCheck %s --check-prefix=ASM
+; RUN: llc -mtriple powerpc-ibm-aix-xcoff -filetype=obj < %s | \
+; RUN:   llvm-dwarfdump -i - | FileCheck %s --check-prefix=OBJ
+; RUN: llc -mtriple powerpc64-ibm-aix-xcoff -filetype=obj < %s | \
+; RUN:   llvm-dwarfdump -i - | FileCheck %s --check-prefix=OBJ
+
+; ASM:         .dwsect 0x10000
+; ASM-NEXT:    .dwinfo:
+; ASM:         .byte{{.*}}DW_TAG_variable
+; ASM-NOT:     .byte{{.*}}DW_AT_location
+; ASM-NOT:     .vbyte{{.*}}i[TL]
+; ASM:         .byte{{.*}}DW_TAG_
+
+; OBJ:        DW_TAG_variable
+; OBJ-NEXT:     DW_AT_name{{.*}}("i")
+; OBJ-NEXT:     DW_AT_type
+; OBJ-NEXT:     DW_AT_external
+; OBJ-NEXT:     DW_AT_decl_file
+; OBJ-NEXT:     DW_AT_decl_line
+; OBJ-NOT:      DW_AT_location{{.*}}DW_OP_form_tls_address
+; OBJ:        DW_TAG_
+
+ at i = thread_local global i32 20, align 4, !dbg !0
+
+define i32 @foo() !dbg !12 {
+entry:
+  %retval = alloca i32, align 4
+  store i32 0, i32* %retval, align 4
+  %0 = load i32, i32* @i, align 4, !dbg !16
+  ret i32 %0, !dbg !16
+}
+
+!llvm.dbg.cu = !{!2}
+!llvm.module.flags = !{!6, !7, !8, !9, !10}
+!llvm.ident = !{!11}
+
+!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
+!1 = distinct !DIGlobalVariable(name: "i", scope: !2, file: !3, line: 2, type: !5, isLocal: false, isDefinition: true)
+!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "IBM Open XL C/C++ for AIX", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, globals: !4, splitDebugInlining: false, nameTableKind: None)
+!3 = !DIFile(filename: "t.c", directory: ".")
+!4 = !{!0}
+!5 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
+!6 = !{i32 7, !"Dwarf Version", i32 3}
+!7 = !{i32 2, !"Debug Info Version", i32 3}
+!8 = !{i32 1, !"wchar_size", i32 2}
+!9 = !{i32 7, !"PIC Level", i32 2}
+!10 = !{i32 7, !"frame-pointer", i32 2}
+!11 = !{!"IBM Open XL C/C++ for AIX"}
+!12 = distinct !DISubprogram(name: "foo", scope: !3, file: !3, line: 3, type: !13, scopeLine: 3, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !15)
+!13 = !DISubroutineType(types: !14)
+!14 = !{!5}
+!15 = !{}
+!16 = !DILocation(line: 4, scope: !12)
Index: llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
===================================================================
--- llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+++ llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
@@ -2469,6 +2469,13 @@
   PersonalityEncoding = 0;
   LSDAEncoding = 0;
   CallSiteEncoding = dwarf::DW_EH_PE_udata4;
+
+  // AIX debug for thread local location is not ready. And for integrated as
+  // mode, the relocatable address for the thread local variable will cause
+  // linker error. So disable the location attribute generation for thread local
+  // variables for now.
+  // FIXME: when TLS debug on AIX is ready, remove this setting.
+  SupportDebugThreadLocalLocation = false;
 }
 
 MCSection *TargetLoweringObjectFileXCOFF::getStaticCtorSection(


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D130245.452076.patch
Type: text/x-patch
Size: 3302 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220812/769c4e1b/attachment.bin>


More information about the llvm-commits mailing list