[llvm] [PowerPC] Function descriptor symbol can be omitted for external symbol. (PR #97526)

via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 2 23:42:42 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-backend-powerpc

Author: Esme (EsmeYi)

<details>
<summary>Changes</summary>

For external symbols, the function descriptor may be omitted unless its address is taken.

---

Patch is 46.42 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/97526.diff


8 Files Affected:

- (modified) llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (+9-2) 
- (modified) llvm/test/CodeGen/PowerPC/aix-available-externally-linkage-fun.ll (-16) 
- (modified) llvm/test/CodeGen/PowerPC/aix-extern-weak.ll (+17-39) 
- (modified) llvm/test/CodeGen/PowerPC/aix-extern.ll (+22-44) 
- (modified) llvm/test/CodeGen/PowerPC/aix-text-ref.ll (-2) 
- (modified) llvm/test/CodeGen/PowerPC/aix-xcoff-funcsect.ll (+64-67) 
- (modified) llvm/test/CodeGen/PowerPC/aix-xcoff-reloc.ll (+34-55) 
- (modified) llvm/test/CodeGen/PowerPC/aix-xcoff-visibility.ll (-21) 


``````````diff
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index c52cbff689dc5..debe8efbecb41 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -2325,8 +2325,15 @@ bool AsmPrinter::doFinalization(Module &M) {
     // Emit linkage for the function entry point.
     emitLinkage(&F, FnEntryPointSym);
 
-    // Emit linkage for the function descriptor.
-    emitLinkage(&F, Name);
+    // If address is taken from an extern function, we need to emit linkage for
+    // its function descriptor symbol.
+    if (F.hasAddressTaken(/*PutOffender=*/nullptr,
+                          /*IgnoreCallbackUses=*/false,
+                          /*IgnoreAssumeLikeCalls=*/true,
+                          /*IgnoreLLVMUsed=*/true,
+                          /*IgnoreARCAttachedCall=*/false,
+                          /*IgnoreCastedDirectCall=*/true))
+      emitLinkage(&F, Name);
   }
 
   // Emit the remarks section contents.
diff --git a/llvm/test/CodeGen/PowerPC/aix-available-externally-linkage-fun.ll b/llvm/test/CodeGen/PowerPC/aix-available-externally-linkage-fun.ll
index 0ad229004b8a3..fd39fb6d16590 100644
--- a/llvm/test/CodeGen/PowerPC/aix-available-externally-linkage-fun.ll
+++ b/llvm/test/CodeGen/PowerPC/aix-available-externally-linkage-fun.ll
@@ -18,7 +18,6 @@ entry:
 }
 
 ; CHECK: .extern .foo[PR]
-; CHECK: .extern foo[DS]
 
 ; OBJ:      Name: .foo
 ; OBJ-NEXT: Value (RelocatableAddress): 0x0
@@ -34,18 +33,3 @@ entry:
 ; OBJ-NEXT:   SymbolAlignmentLog2: 0
 ; OBJ-NEXT:   SymbolType: XTY_ER (0x0)
 ; OBJ-NEXT:   StorageMappingClass: XMC_PR (0x0)
-
-; OBJ:      Name: foo
-; OBJ-NEXT: Value (RelocatableAddress): 0x0
-; OBJ-NEXT: Section: N_UNDEF
-; OBJ-NEXT: Type: 0x0
-; OBJ-NEXT: StorageClass: C_EXT (0x2)
-; OBJ-NEXT: NumberOfAuxEntries: 1
-; OBJ-NEXT: CSECT Auxiliary Entry {
-; OBJ-NEXT:   Index: [[#NFA+4]]
-; OBJ-NEXT:   SectionLen: 0
-; OBJ-NEXT:   ParameterHashIndex: 0x0
-; OBJ-NEXT:   TypeChkSectNum: 0x0
-; OBJ-NEXT:   SymbolAlignmentLog2: 0
-; OBJ-NEXT:   SymbolType: XTY_ER (0x0)
-; OBJ-NEXT:   StorageMappingClass: XMC_DS (0xA)
diff --git a/llvm/test/CodeGen/PowerPC/aix-extern-weak.ll b/llvm/test/CodeGen/PowerPC/aix-extern-weak.ll
index ea61fdb022b5c..173c58567e40b 100644
--- a/llvm/test/CodeGen/PowerPC/aix-extern-weak.ll
+++ b/llvm/test/CodeGen/PowerPC/aix-extern-weak.ll
@@ -55,7 +55,6 @@ declare extern_weak void @foo_ext_weak(ptr)
 ; COMMON-NEXT:    .weak   .foo_ext_weak_ref[PR]
 ; COMMON-NEXT:    .weak   foo_ext_weak_ref[DS]
 ; COMMON-NEXT:    .weak   .foo_ext_weak[PR]
-; COMMON-NEXT:    .weak   foo_ext_weak[DS]
 ; COMMON-NEXT:    .toc
 ; COMMON-NEXT: L..C0:
 ; COMMON-NEXT:    .tc foo_ext_weak_p[TC],foo_ext_weak_p
@@ -159,27 +158,6 @@ declare extern_weak void @foo_ext_weak(ptr)
 ; CHECKSYM-NEXT:   }
 ; CHECKSYM-NEXT:   Symbol {
 ; CHECKSYM-NEXT:     Index: [[#Index+8]]
-; CHECKSYM-NEXT:     Name: foo_ext_weak
-; CHECKSYM-NEXT:     Value (RelocatableAddress): 0x0
-; CHECKSYM-NEXT:     Section: N_UNDEF
-; CHECKSYM-NEXT:     Type: 0x0
-; CHECKSYM-NEXT:     StorageClass: C_WEAKEXT (0x6F)
-; CHECKSYM-NEXT:     NumberOfAuxEntries: 1
-; CHECKSYM-NEXT:     CSECT Auxiliary Entry {
-; CHECKSYM-NEXT:       Index: [[#Index+9]]
-; CHECKSYM-NEXT:       SectionLen: 0
-; CHECKSYM-NEXT:       ParameterHashIndex: 0x0
-; CHECKSYM-NEXT:       TypeChkSectNum: 0x0
-; CHECKSYM-NEXT:       SymbolAlignmentLog2: 0
-; CHECKSYM-NEXT:       SymbolType: XTY_ER (0x0)
-; CHECKSYM-NEXT:       StorageMappingClass: XMC_DS (0xA)
-; CHECKSYM32-NEXT:     StabInfoIndex: 0x0
-; CHECKSYM32-NEXT:     StabSectNum: 0x0
-; CHECKSYM64-NEXT:     Auxiliary Type: AUX_CSECT (0xFB)
-; CHECKSYM-NEXT:     }
-; CHECKSYM-NEXT:   }
-; CHECKSYM-NEXT:   Symbol {
-; CHECKSYM-NEXT:     Index: [[#Index+10]]
 ; CHECKSYM-NEXT:     Name:
 ; CHECKSYM-NEXT:     Value (RelocatableAddress): 0x0
 ; CHECKSYM-NEXT:     Section: .text
@@ -187,7 +165,7 @@ declare extern_weak void @foo_ext_weak(ptr)
 ; CHECKSYM-NEXT:     StorageClass: C_HIDEXT (0x6B)
 ; CHECKSYM-NEXT:     NumberOfAuxEntries: 1
 ; CHECKSYM-NEXT:     CSECT Auxiliary Entry {
-; CHECKSYM-NEXT:       Index: [[#Index+11]]
+; CHECKSYM-NEXT:       Index: [[#Index+9]]
 ; CHECKSYM-NEXT:       SectionLen: 80
 ; CHECKSYM-NEXT:       ParameterHashIndex: 0x0
 ; CHECKSYM-NEXT:       TypeChkSectNum: 0x0
@@ -200,7 +178,7 @@ declare extern_weak void @foo_ext_weak(ptr)
 ; CHECKSYM-NEXT:     }
 ; CHECKSYM-NEXT:   }
 ; CHECKSYM-NEXT:   Symbol {
-; CHECKSYM-NEXT:     Index: [[#Index+12]]
+; CHECKSYM-NEXT:     Index: [[#Index+10]]
 ; CHECKSYM-NEXT:     Name: .main
 ; CHECKSYM-NEXT:     Value (RelocatableAddress): 0x0
 ; CHECKSYM-NEXT:     Section: .text
@@ -208,8 +186,8 @@ declare extern_weak void @foo_ext_weak(ptr)
 ; CHECKSYM-NEXT:     StorageClass: C_EXT (0x2)
 ; CHECKSYM-NEXT:     NumberOfAuxEntries: 1
 ; CHECKSYM-NEXT:     CSECT Auxiliary Entry {
-; CHECKSYM-NEXT:       Index: [[#Index+13]]
-; CHECKSYM-NEXT:       ContainingCsectSymbolIndex: [[#Index+10]]
+; CHECKSYM-NEXT:       Index: [[#Index+11]]
+; CHECKSYM-NEXT:       ContainingCsectSymbolIndex: [[#Index+8]]
 ; CHECKSYM-NEXT:       ParameterHashIndex: 0x0
 ; CHECKSYM-NEXT:       TypeChkSectNum: 0x0
 ; CHECKSYM-NEXT:       SymbolAlignmentLog2: 0
@@ -221,7 +199,7 @@ declare extern_weak void @foo_ext_weak(ptr)
 ; CHECKSYM-NEXT:     }
 ; CHECKSYM-NEXT:   }
 ; CHECKSYM-NEXT:   Symbol {
-; CHECKSYM-NEXT:     Index: [[#Index+14]]
+; CHECKSYM-NEXT:     Index: [[#Index+12]]
 ; CHECKSYM-NEXT:     Name: .data
 ; CHECKSYM-NEXT:     Value (RelocatableAddress): 0x50
 ; CHECKSYM-NEXT:     Section: .data
@@ -229,7 +207,7 @@ declare extern_weak void @foo_ext_weak(ptr)
 ; CHECKSYM-NEXT:     StorageClass: C_HIDEXT (0x6B)
 ; CHECKSYM-NEXT:     NumberOfAuxEntries: 1
 ; CHECKSYM-NEXT:     CSECT Auxiliary Entry {
-; CHECKSYM-NEXT:       Index: [[#Index+15]]
+; CHECKSYM-NEXT:       Index: [[#Index+13]]
 ; CHECKSYM32-NEXT:     SectionLen: 4
 ; CHECKSYM64-NEXT:     SectionLen: 8
 ; CHECKSYM-NEXT:       ParameterHashIndex: 0x0
@@ -244,7 +222,7 @@ declare extern_weak void @foo_ext_weak(ptr)
 ; CHECKSYM-NEXT:     }
 ; CHECKSYM-NEXT:   }
 ; CHECKSYM-NEXT:   Symbol {
-; CHECKSYM-NEXT:     Index: [[#Index+16]]
+; CHECKSYM-NEXT:     Index: [[#Index+14]]
 ; CHECKSYM-NEXT:     Name: foo_ext_weak_p
 ; CHECKSYM-NEXT:     Value (RelocatableAddress): 0x50
 ; CHECKSYM-NEXT:     Section: .data
@@ -252,8 +230,8 @@ declare extern_weak void @foo_ext_weak(ptr)
 ; CHECKSYM-NEXT:     StorageClass: C_EXT (0x2)
 ; CHECKSYM-NEXT:     NumberOfAuxEntries: 1
 ; CHECKSYM-NEXT:     CSECT Auxiliary Entry {
-; CHECKSYM-NEXT:       Index: [[#Index+17]]
-; CHECKSYM-NEXT:       ContainingCsectSymbolIndex: [[#Index+14]]
+; CHECKSYM-NEXT:       Index: [[#Index+15]]
+; CHECKSYM-NEXT:       ContainingCsectSymbolIndex: [[#Index+12]]
 ; CHECKSYM-NEXT:       ParameterHashIndex: 0x0
 ; CHECKSYM-NEXT:       TypeChkSectNum: 0x0
 ; CHECKSYM-NEXT:       SymbolAlignmentLog2: 0
@@ -265,7 +243,7 @@ declare extern_weak void @foo_ext_weak(ptr)
 ; CHECKSYM-NEXT:     }
 ; CHECKSYM-NEXT:   }
 ; CHECKSYM-NEXT:   Symbol {
-; CHECKSYM-NEXT:     Index: [[#Index+18]]
+; CHECKSYM-NEXT:     Index: [[#Index+16]]
 ; CHECKSYM-NEXT:     Name: main
 ; CHECKSYM32-NEXT:   Value (RelocatableAddress): 0x54
 ; CHECKSYM64-NEXT:   Value (RelocatableAddress): 0x58
@@ -274,7 +252,7 @@ declare extern_weak void @foo_ext_weak(ptr)
 ; CHECKSYM-NEXT:     StorageClass: C_EXT (0x2)
 ; CHECKSYM-NEXT:     NumberOfAuxEntries: 1
 ; CHECKSYM-NEXT:     CSECT Auxiliary Entry {
-; CHECKSYM-NEXT:       Index: [[#Index+19]]
+; CHECKSYM-NEXT:       Index: [[#Index+17]]
 ; CHECKSYM32-NEXT:     SectionLen: 12
 ; CHECKSYM64-NEXT:     SectionLen: 24
 ; CHECKSYM-NEXT:       ParameterHashIndex: 0x0
@@ -289,7 +267,7 @@ declare extern_weak void @foo_ext_weak(ptr)
 ; CHECKSYM-NEXT:     }
 ; CHECKSYM-NEXT:   }
 ; CHECKSYM-NEXT:   Symbol {
-; CHECKSYM-NEXT:     Index: [[#Index+20]]
+; CHECKSYM-NEXT:     Index: [[#Index+18]]
 ; CHECKSYM-NEXT:     Name: TOC
 ; CHECKSYM32-NEXT:   Value (RelocatableAddress): 0x60
 ; CHECKSYM64-NEXT:   Value (RelocatableAddress): 0x70
@@ -298,7 +276,7 @@ declare extern_weak void @foo_ext_weak(ptr)
 ; CHECKSYM-NEXT:     StorageClass: C_HIDEXT (0x6B)
 ; CHECKSYM-NEXT:     NumberOfAuxEntries: 1
 ; CHECKSYM-NEXT:     CSECT Auxiliary Entry {
-; CHECKSYM-NEXT:       Index: [[#Index+21]]
+; CHECKSYM-NEXT:       Index: [[#Index+19]]
 ; CHECKSYM-NEXT:       SectionLen: 0
 ; CHECKSYM-NEXT:       ParameterHashIndex: 0x0
 ; CHECKSYM-NEXT:       TypeChkSectNum: 0x0
@@ -311,7 +289,7 @@ declare extern_weak void @foo_ext_weak(ptr)
 ; CHECKSYM-NEXT:     }
 ; CHECKSYM-NEXT:   }
 ; CHECKSYM-NEXT:   Symbol {
-; CHECKSYM-NEXT:     Index: [[#Index+22]]
+; CHECKSYM-NEXT:     Index: [[#Index+20]]
 ; CHECKSYM-NEXT:     Name: foo_ext_weak_p
 ; CHECKSYM32-NEXT:   Value (RelocatableAddress): 0x60
 ; CHECKSYM64-NEXT:   Value (RelocatableAddress): 0x70
@@ -320,7 +298,7 @@ declare extern_weak void @foo_ext_weak(ptr)
 ; CHECKSYM-NEXT:     StorageClass: C_HIDEXT (0x6B)
 ; CHECKSYM-NEXT:     NumberOfAuxEntries: 1
 ; CHECKSYM-NEXT:     CSECT Auxiliary Entry {
-; CHECKSYM-NEXT:       Index: [[#Index+23]]
+; CHECKSYM-NEXT:       Index: [[#Index+21]]
 ; CHECKSYM32-NEXT:     SectionLen: 4
 ; CHECKSYM64-NEXT:     SectionLen: 8
 ; CHECKSYM-NEXT:       ParameterHashIndex: 0x0
@@ -335,7 +313,7 @@ declare extern_weak void @foo_ext_weak(ptr)
 ; CHECKSYM-NEXT:     }
 ; CHECKSYM-NEXT:   }
 ; CHECKSYM-NEXT:   Symbol {
-; CHECKSYM-NEXT:     Index: [[#Index+24]]
+; CHECKSYM-NEXT:     Index: [[#Index+22]]
 ; CHECKSYM-NEXT:     Name: b_w
 ; CHECKSYM32-NEXT:   Value (RelocatableAddress): 0x64
 ; CHECKSYM64-NEXT:   Value (RelocatableAddress): 0x78
@@ -344,7 +322,7 @@ declare extern_weak void @foo_ext_weak(ptr)
 ; CHECKSYM-NEXT:     StorageClass: C_HIDEXT (0x6B)
 ; CHECKSYM-NEXT:     NumberOfAuxEntries: 1
 ; CHECKSYM-NEXT:     CSECT Auxiliary Entry {
-; CHECKSYM-NEXT:       Index: [[#Index+25]]
+; CHECKSYM-NEXT:       Index: [[#Index+23]]
 ; CHECKSYM32-NEXT:     SectionLen: 4
 ; CHECKSYM64-NEXT:     SectionLen: 8
 ; CHECKSYM-NEXT:       ParameterHashIndex: 0x0
diff --git a/llvm/test/CodeGen/PowerPC/aix-extern.ll b/llvm/test/CodeGen/PowerPC/aix-extern.ll
index b4366dddedb2f..ff2a803608807 100644
--- a/llvm/test/CodeGen/PowerPC/aix-extern.ll
+++ b/llvm/test/CodeGen/PowerPC/aix-extern.ll
@@ -78,7 +78,6 @@ declare i32 @bar_extern(ptr)
 ; COMMON-NEXT:      .extern .bar_ref
 ; COMMON-NEXT:      .extern bar_ref[DS]
 ; COMMON-NEXT:	    .extern	.bar_extern
-; COMMON-NEXT:      .extern     bar_extern[DS]
 ; COMMON-NEXT:	    .toc
 ; COMMON-NEXT: L..C0:
 ; COMMON-NEXT:      .tc b_e[TC],b_e[UA]
@@ -182,27 +181,6 @@ declare i32 @bar_extern(ptr)
 ; CHECKSYM-NEXT:   }
 ; CHECKSYM-NEXT:   Symbol {
 ; CHECKSYM-NEXT:     Index: [[#Index+8]]
-; CHECKSYM-NEXT:     Name: bar_extern
-; CHECKSYM-NEXT:     Value (RelocatableAddress): 0x0
-; CHECKSYM-NEXT:     Section: N_UNDEF
-; CHECKSYM-NEXT:     Type: 0x0
-; CHECKSYM-NEXT:     StorageClass: C_EXT (0x2)
-; CHECKSYM-NEXT:     NumberOfAuxEntries: 1
-; CHECKSYM-NEXT:     CSECT Auxiliary Entry {
-; CHECKSYM-NEXT:       Index: [[#Index+9]]
-; CHECKSYM-NEXT:       SectionLen: 0
-; CHECKSYM-NEXT:       ParameterHashIndex: 0x0
-; CHECKSYM-NEXT:       TypeChkSectNum: 0x0
-; CHECKSYM-NEXT:       SymbolAlignmentLog2: 0
-; CHECKSYM-NEXT:       SymbolType: XTY_ER (0x0)
-; CHECKSYM-NEXT:       StorageMappingClass: XMC_DS (0xA)
-; CHECKSYM32-NEXT:     StabInfoIndex: 0x0
-; CHECKSYM32-NEXT:     StabSectNum: 0x0
-; CHECKSYM64-NEXT:     Auxiliary Type: AUX_CSECT (0xFB)
-; CHECKSYM-NEXT:     }
-; CHECKSYM-NEXT:   }
-; CHECKSYM-NEXT:   Symbol {
-; CHECKSYM-NEXT:     Index: [[#Index+10]]
 ; CHECKSYM-NEXT:     Name:
 ; CHECKSYM-NEXT:     Value (RelocatableAddress): 0x0
 ; CHECKSYM-NEXT:     Section: .text
@@ -210,7 +188,7 @@ declare i32 @bar_extern(ptr)
 ; CHECKSYM-NEXT:     StorageClass: C_HIDEXT (0x6B)
 ; CHECKSYM-NEXT:     NumberOfAuxEntries: 1
 ; CHECKSYM-NEXT:     CSECT Auxiliary Entry {
-; CHECKSYM-NEXT:       Index: [[#Index+11]]
+; CHECKSYM-NEXT:       Index: [[#Index+9]]
 ; CHECKSYM-NEXT:       SectionLen: 112
 ; CHECKSYM-NEXT:       ParameterHashIndex: 0x0
 ; CHECKSYM-NEXT:       TypeChkSectNum: 0x0
@@ -223,7 +201,7 @@ declare i32 @bar_extern(ptr)
 ; CHECKSYM-NEXT:     }
 ; CHECKSYM-NEXT:   }
 ; CHECKSYM-NEXT:   Symbol {
-; CHECKSYM-NEXT:     Index: [[#Index+12]]
+; CHECKSYM-NEXT:     Index: [[#Index+10]]
 ; CHECKSYM-NEXT:     Name: .foo
 ; CHECKSYM-NEXT:     Value (RelocatableAddress): 0x0
 ; CHECKSYM-NEXT:     Section: .text
@@ -231,8 +209,8 @@ declare i32 @bar_extern(ptr)
 ; CHECKSYM-NEXT:     StorageClass: C_EXT (0x2)
 ; CHECKSYM-NEXT:     NumberOfAuxEntries: 1
 ; CHECKSYM-NEXT:     CSECT Auxiliary Entry {
-; CHECKSYM-NEXT:       Index: [[#Index+13]]
-; CHECKSYM-NEXT:       ContainingCsectSymbolIndex: [[#Index+10]]
+; CHECKSYM-NEXT:       Index: [[#Index+11]]
+; CHECKSYM-NEXT:       ContainingCsectSymbolIndex: [[#Index+8]]
 ; CHECKSYM-NEXT:       ParameterHashIndex: 0x0
 ; CHECKSYM-NEXT:       TypeChkSectNum: 0x0
 ; CHECKSYM-NEXT:       SymbolAlignmentLog2: 0
@@ -244,7 +222,7 @@ declare i32 @bar_extern(ptr)
 ; CHECKSYM-NEXT:     }
 ; CHECKSYM-NEXT:   }
 ; CHECKSYM-NEXT:   Symbol {
-; CHECKSYM-NEXT:     Index: [[#Index+14]]
+; CHECKSYM-NEXT:     Index: [[#Index+12]]
 ; CHECKSYM-NEXT:     Name: .main
 ; CHECKSYM-NEXT:     Value (RelocatableAddress): 0x10
 ; CHECKSYM-NEXT:     Section: .text
@@ -252,8 +230,8 @@ declare i32 @bar_extern(ptr)
 ; CHECKSYM-NEXT:     StorageClass: C_EXT (0x2)
 ; CHECKSYM-NEXT:     NumberOfAuxEntries: 1
 ; CHECKSYM-NEXT:     CSECT Auxiliary Entry {
-; CHECKSYM-NEXT:       Index: [[#Index+15]]
-; CHECKSYM-NEXT:       ContainingCsectSymbolIndex: [[#Index+10]]
+; CHECKSYM-NEXT:       Index: [[#Index+13]]
+; CHECKSYM-NEXT:       ContainingCsectSymbolIndex: [[#Index+8]]
 ; CHECKSYM-NEXT:       ParameterHashIndex: 0x0
 ; CHECKSYM-NEXT:       TypeChkSectNum: 0x0
 ; CHECKSYM-NEXT:       SymbolAlignmentLog2: 0
@@ -265,7 +243,7 @@ declare i32 @bar_extern(ptr)
 ; CHECKSYM-NEXT:     }
 ; CHECKSYM-NEXT:   }
 ; CHECKSYM-NEXT:   Symbol {
-; CHECKSYM-NEXT:     Index: [[#Index+16]]
+; CHECKSYM-NEXT:     Index: [[#Index+14]]
 ; CHECKSYM-NEXT:     Name: .data
 ; CHECKSYM-NEXT:     Value (RelocatableAddress): 0x70
 ; CHECKSYM-NEXT:     Section: .data
@@ -273,7 +251,7 @@ declare i32 @bar_extern(ptr)
 ; CHECKSYM-NEXT:     StorageClass: C_HIDEXT (0x6B)
 ; CHECKSYM-NEXT:     NumberOfAuxEntries: 1
 ; CHECKSYM-NEXT:     CSECT Auxiliary Entry {
-; CHECKSYM-NEXT:       Index: [[#Index+17]]
+; CHECKSYM-NEXT:       Index: [[#Index+15]]
 ; CHECKSYM32-NEXT:     SectionLen: 4
 ; CHECKSYM64-NEXT:     SectionLen: 8
 ; CHECKSYM-NEXT:       ParameterHashIndex: 0x0
@@ -288,7 +266,7 @@ declare i32 @bar_extern(ptr)
 ; CHECKSYM-NEXT:     }
 ; CHECKSYM-NEXT:   }
 ; CHECKSYM-NEXT:   Symbol {
-; CHECKSYM-NEXT:     Index: [[#Index+18]]
+; CHECKSYM-NEXT:     Index: [[#Index+16]]
 ; CHECKSYM-NEXT:     Name: bar_p
 ; CHECKSYM-NEXT:     Value (RelocatableAddress): 0x70
 ; CHECKSYM-NEXT:     Section: .data
@@ -296,8 +274,8 @@ declare i32 @bar_extern(ptr)
 ; CHECKSYM-NEXT:     StorageClass: C_EXT (0x2)
 ; CHECKSYM-NEXT:     NumberOfAuxEntries: 1
 ; CHECKSYM-NEXT:     CSECT Auxiliary Entry {
-; CHECKSYM-NEXT:       Index: [[#Index+19]]
-; CHECKSYM-NEXT:       ContainingCsectSymbolIndex: [[#Index+16]]
+; CHECKSYM-NEXT:       Index: [[#Index+17]]
+; CHECKSYM-NEXT:       ContainingCsectSymbolIndex: [[#Index+14]]
 ; CHECKSYM-NEXT:       ParameterHashIndex: 0x0
 ; CHECKSYM-NEXT:       TypeChkSectNum: 0x0
 ; CHECKSYM-NEXT:       SymbolAlignmentLog2: 0
@@ -309,7 +287,7 @@ declare i32 @bar_extern(ptr)
 ; CHECKSYM-NEXT:     }
 ; CHECKSYM-NEXT:   }
 ; CHECKSYM-NEXT:   Symbol {
-; CHECKSYM-NEXT:     Index: [[#Index+20]]
+; CHECKSYM-NEXT:     Index: [[#Index+18]]
 ; CHECKSYM-NEXT:     Name: foo
 ; CHECKSYM32-NEXT:   Value (RelocatableAddress): 0x74
 ; CHECKSYM64-NEXT:   Value (RelocatableAddress): 0x78
@@ -318,7 +296,7 @@ declare i32 @bar_extern(ptr)
 ; CHECKSYM-NEXT:     StorageClass: C_EXT (0x2)
 ; CHECKSYM-NEXT:     NumberOfAuxEntries: 1
 ; CHECKSYM-NEXT:     CSECT Auxiliary Entry {
-; CHECKSYM-NEXT:       Index: [[#Index+21]]
+; CHECKSYM-NEXT:       Index: [[#Index+19]]
 ; CHECKSYM32-NEXT:     SectionLen: 12
 ; CHECKSYM64-NEXT:     SectionLen: 24
 ; CHECKSYM-NEXT:       ParameterHashIndex: 0x0
@@ -333,7 +311,7 @@ declare i32 @bar_extern(ptr)
 ; CHECKSYM-NEXT:     }
 ; CHECKSYM-NEXT:   }
 ; CHECKSYM-NEXT:   Symbol {
-; CHECKSYM-NEXT:     Index: [[#Index+22]]
+; CHECKSYM-NEXT:     Index: [[#Index+20]]
 ; CHECKSYM-NEXT:     Name: main
 ; CHECKSYM32-NEXT:   Value (RelocatableAddress): 0x80
 ; CHECKSYM64-NEXT:   Value (RelocatableAddress): 0x90
@@ -342,7 +320,7 @@ declare i32 @bar_extern(ptr)
 ; CHECKSYM-NEXT:     StorageClass: C_EXT (0x2)
 ; CHECKSYM-NEXT:     NumberOfAuxEntries: 1
 ; CHECKSYM-NEXT:     CSECT Auxiliary Entry {
-; CHECKSYM-NEXT:       Index: [[#Index+23]]
+; CHECKSYM-NEXT:       Index: [[#Index+21]]
 ; CHECKSYM32-NEXT:     SectionLen: 12
 ; CHECKSYM64-NEXT:     SectionLen: 24
 ; CHECKSYM-NEXT:       ParameterHashIndex: 0x0
@@ -357,7 +335,7 @@ declare i32 @bar_extern(ptr)
 ; CHECKSYM-NEXT:     }
 ; CHECKSYM-NEXT:   }
 ; CHECKSYM-NEXT:   Symbol {
-; CHECKSYM-NEXT:     Index: [[#Index+24]]
+; CHECKSYM-NEXT:     Index: [[#Index+22]]
 ; CHECKSYM-NEXT:     Name: TOC
 ; CHECKSYM32-NEXT:   Value (RelocatableAddress): 0x8C
 ; CHECKSYM64-NEXT:   Value (RelocatableAddress): 0xA8
@@ -366,7 +344,7 @@ declare i32 @bar_extern(ptr)
 ; CHECKSYM-NEXT:     StorageClass: C_HIDEXT (0x6B)
 ; CHECKSYM-NEXT:     NumberOfAuxEntries: 1
 ; CHECKSYM-NEXT:     CSECT Auxiliary Entry {
-; CHECKSYM-NEXT:       Index: [[#Index+25]]
+; CHECKSYM-NEXT:       Index: [[#Index+23]]
 ; CHECKSYM-NEXT:       SectionLen: 0
 ; CHECKSYM-NEXT:       ParameterHashIndex: 0x0
 ; CHECKSYM-NEXT:       TypeChkSectNum: 0x0
@@ -379,7 +357,7 @@ declare i32 @bar_extern(ptr)
 ; CHECKSYM-NEXT:     }
 ; CHECKSYM-NEXT:   }
 ; CHECKSYM-NEXT:   Symbol {
-; CHECKSYM-NEXT:     Index: [[#Index+26]]
+; CHECKSYM-NEXT:     Index: [[#Index+24]]
 ; CHECKSYM-NEXT:     Name: b_e
 ; CHECKSYM32-NEXT:   Value (RelocatableAddress): 0x8C
 ; CHECKSYM64-NEXT:   Value (RelocatableAddress): 0xA8
@@ -388,7 +366,7 @@ declare i32 @bar_extern(ptr)
 ; CHECKSYM-NEXT:     StorageClass: C_HIDEXT (0x6B)
 ; CHECKSYM-NEXT:     NumberOfAuxEntries: 1
 ; CHECKSYM-NEXT:     CSECT Auxiliary Entry {
-; CHECKSYM-NEXT:       Index: [[#Index+27]]
+; CHECKSYM-NEXT:       Index: [[#Index+25]]
 ; CHECKSYM32-NEXT:     SectionLen: 4
 ; CHECKSYM64-NEXT:     SectionLen: 8
 ; CHECKSYM-NEXT:       ParameterHashIndex: 0x0
@@ -403,7 +381,7 @@ declare i32 @bar_extern(ptr)
 ; CHECKSYM-NEXT:     }
 ; CHECKSYM-NEXT:   }
 ; CHECKSYM-NEXT:   Symbol {
-; CHECKSYM-NEXT:     Index: [[#Index+28]]
+; CHECKSYM-NEXT:     Index: [[#Index+26]]
 ; CHECKSYM-NEXT:     Name: bar_p
 ; CHECKSYM32-NEXT:   Value (RelocatableAddress): 0x90
 ; CHECKSYM64-NEXT:   Value (RelocatableAddress): 0xB0
@@ -412,7 +390,7 @@ declare i32 @bar_extern(ptr)
 ; CHECKSYM-NEXT:     StorageClass: C_HIDEXT (0x6B)
 ; CHECKSYM-NEXT:     NumberOfAuxEntries: 1
 ; CHECKSYM-NEXT:     CSECT Auxiliary Entry {
-; CHECKSYM-NEXT:       Index: [[#Index+29]]
+; CHECKSYM-NEXT:       Index: [[#Index+27]]
 ; CHECKSYM32-NEXT:     SectionLen: 4
 ; CHECKSYM64-NEXT:     SectionLen: 8
 ; CHECKSYM-NEXT:       ParameterHashIndex: 0x0
diff --git a/llvm/test/CodeGen/PowerPC/aix-text-ref.ll b/llvm/test/CodeGen/PowerPC/aix-text-ref.ll
index 175c8ccd2a49b..0dfa618240276 100644
--- a/llvm/test/CodeGen/PowerPC/aix-text-ref.ll
+++ b/llvm/test/CodeGen/PowerPC/aix-text-ref.ll
@@ -14,7 +14,5 @@ entry:
 declare i32 @text(...)
 
 ; CHECK32: 00000000         *UND*  00000000 (idx: {{[[:digit:]]*}}) .text[PR]
-; CHECK32: 00000000         *UND*  00000000 (idx: {{[[:digit:]]*}}) text[DS]
 
 ; CHECK64: 0000000000000000         *UND*  0000000000000000 (idx: {{[[:digit:]]*}}) .text[PR]
-; CHECK64: 0000000000000000         *UND*  0000000000000000 (idx: {{[[:digit:]]*}}) text[DS]
diff --git a/llvm/test/CodeGen/PowerPC/aix-xcoff-funcsect.ll b/llvm/test/CodeGen/PowerPC/aix-xcoff-funcsect.ll
index dbfbd0de08b99..13c5f14e67b7e 100644
--- a/llvm/test/CodeGen/PowerPC/aix-xcoff-funcsect.ll
+++ b/llvm/test/CodeGen/PowerPC/aix-xcoff-funcsect.ll
@@ -108,122 +108,119 @@ entry:
 ; ASM-NEXT:  # %bb.0:                                # %entry
 ; ASM-NEXT:  	blr
 ; ASM:        .extern	.extern_foo
-; ASM-NEXT:  	.extern	extern_foo[D...
[truncated]

``````````

</details>


https://github.com/llvm/llvm-project/pull/97526


More information about the llvm-commits mailing list