[llvm] [AIX] [XCOFF] Add support for common and local common symbols in the TOC (PR #79530)
zhijian lin via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 30 13:18:09 PST 2024
================
@@ -0,0 +1,204 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc -mtriple powerpc-ibm-aix-xcoff -verify-machineinstrs < %s | FileCheck %s --check-prefix CHECK
+; RUN: llc -mtriple powerpc64-ibm-aix-xcoff -verify-machineinstrs < %s | FileCheck %s --check-prefix CHECK64
+
+; RUN: llc -filetype=obj -mtriple powerpc-ibm-aix-xcoff -verify-machineinstrs < %s -o %t32.o
+; RUN: llvm-objdump -t --symbol-description %t32.o | FileCheck %s --check-prefix=OBJ32
+
+; RUN: llc -filetype=obj -mtriple powerpc64-ibm-aix-xcoff -verify-machineinstrs < %s -o %t64.o
+; RUN: llvm-objdump -t --symbol-description %t64.o | FileCheck %s --check-prefix=OBJ64
+
+ at a1 = common global i32 0, align 4 #0
+ at a2 = global i32 0, align 4 #0
+ at a3 = common global i32 0, align 4
+ at a4 = global i32 0, align 4
+
+define void @set(i32 noundef %_a) {
+; CHECK-LABEL: set:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: la 4, a2[TD](2)
+; CHECK-NEXT: la 5, a1[TD](2)
+; CHECK-NEXT: stw 3, 0(4)
+; CHECK-NEXT: lwz 4, L..C0(2) # @a4
+; CHECK-NEXT: stw 3, 0(5)
+; CHECK-NEXT: lwz 5, L..C1(2) # @a3
+; CHECK-NEXT: stw 3, 0(4)
+; CHECK-NEXT: stw 3, 0(5)
+; CHECK-NEXT: blr
+;
+; CHECK64-LABEL: set:
+; CHECK64: # %bb.0: # %entry
+; CHECK64-NEXT: la 4, a2[TD](2)
+; CHECK64-NEXT: la 5, a1[TD](2)
+; CHECK64-NEXT: stw 3, 0(4)
+; CHECK64-NEXT: ld 4, L..C0(2) # @a4
+; CHECK64-NEXT: stw 3, 0(5)
+; CHECK64-NEXT: ld 5, L..C1(2) # @a3
+; CHECK64-NEXT: stw 3, 0(4)
+; CHECK64-NEXT: stw 3, 0(5)
+; CHECK64-NEXT: blr
----------------
diggerlin wrote:
the most assemble are same. we do not need duplicate here. please fix all the following duplication. please use --check-prefixes=CHECK,COMMON
the only different is
`lwz 5, L..C1(2) # @a3` vs `ld 5, L..C1(2) # @a3`
`lwz 4, L..C1(2) # @a3` vs `ld 4, L..C1(2) # @a3`
https://github.com/llvm/llvm-project/pull/79530
More information about the llvm-commits
mailing list