[llvm] 19b43e1 - [PowerPC][NFC] Pre-commit test case to prepare for patch to merge internal and private global data

Amy Kwan via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 13 08:53:27 PDT 2024


Author: Amy Kwan
Date: 2024-06-13T10:53:19-05:00
New Revision: 19b43e1757b4fd3d0f188cf8a08e9febb0dbec2f

URL: https://github.com/llvm/llvm-project/commit/19b43e1757b4fd3d0f188cf8a08e9febb0dbec2f
DIFF: https://github.com/llvm/llvm-project/commit/19b43e1757b4fd3d0f188cf8a08e9febb0dbec2f.diff

LOG: [PowerPC][NFC] Pre-commit test case to prepare for patch to merge internal and private global data

Added: 
    llvm/test/CodeGen/PowerPC/merge-private.ll

Modified: 
    

Removed: 
    


################################################################################
diff  --git a/llvm/test/CodeGen/PowerPC/merge-private.ll b/llvm/test/CodeGen/PowerPC/merge-private.ll
new file mode 100644
index 0000000000000..6cf276990d7ea
--- /dev/null
+++ b/llvm/test/CodeGen/PowerPC/merge-private.ll
@@ -0,0 +1,108 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
+; RUN: llc -verify-machineinstrs -mtriple powerpc64-ibm-aix-xcoff -mcpu=pwr8 \
+; RUN:     -ppc-asm-full-reg-names < %s | FileCheck %s \
+; RUN:     --check-prefix=AIX64
+; RUN: llc -verify-machineinstrs -mtriple powerpc-ibm-aix-xcoff -mcpu=pwr8 \
+; RUN:     -ppc-asm-full-reg-names < %s | FileCheck %s \
+; RUN:     --check-prefix=AIX32
+; RUN: llc -verify-machineinstrs -mtriple powerpc64le-unknown-linux -mcpu=pwr8 \
+; RUN:     -ppc-asm-full-reg-names < %s | FileCheck %s \
+; RUN:     --check-prefix=LINUX64LE
+; RUN: llc -verify-machineinstrs -mtriple powerpc64-unknown-linux -mcpu=pwr8 \
+; RUN:     -ppc-asm-full-reg-names < %s | FileCheck %s \
+; RUN:     --check-prefix=LINUX64BE
+
+ at .str = private unnamed_addr constant [15 x i8] c"Private global\00", align 1
+ at str = internal constant [16 x i8] c"Internal global\00", align 1
+
+declare noundef signext i32 @puts(ptr nocapture noundef readonly)
+
+define dso_local void @print_func() {
+; AIX64-LABEL: print_func:
+; AIX64:       # %bb.0: # %entry
+; AIX64-NEXT:    mflr r0
+; AIX64-NEXT:    stdu r1, -128(r1)
+; AIX64-NEXT:    std r0, 144(r1)
+; AIX64-NEXT:    std r31, 120(r1) # 8-byte Folded Spill
+; AIX64-NEXT:    ld r31, L..C0(r2) # @__ModuleStringPool
+; AIX64-NEXT:    mr r3, r31
+; AIX64-NEXT:    bl .puts[PR]
+; AIX64-NEXT:    nop
+; AIX64-NEXT:    addi r3, r31, 15
+; AIX64-NEXT:    bl .puts[PR]
+; AIX64-NEXT:    nop
+; AIX64-NEXT:    ld r31, 120(r1) # 8-byte Folded Reload
+; AIX64-NEXT:    addi r1, r1, 128
+; AIX64-NEXT:    ld r0, 16(r1)
+; AIX64-NEXT:    mtlr r0
+; AIX64-NEXT:    blr
+;
+; AIX32-LABEL: print_func:
+; AIX32:       # %bb.0: # %entry
+; AIX32-NEXT:    mflr r0
+; AIX32-NEXT:    stwu r1, -64(r1)
+; AIX32-NEXT:    stw r0, 72(r1)
+; AIX32-NEXT:    stw r31, 60(r1) # 4-byte Folded Spill
+; AIX32-NEXT:    lwz r31, L..C0(r2) # @__ModuleStringPool
+; AIX32-NEXT:    mr r3, r31
+; AIX32-NEXT:    bl .puts[PR]
+; AIX32-NEXT:    nop
+; AIX32-NEXT:    addi r3, r31, 15
+; AIX32-NEXT:    bl .puts[PR]
+; AIX32-NEXT:    nop
+; AIX32-NEXT:    lwz r31, 60(r1) # 4-byte Folded Reload
+; AIX32-NEXT:    addi r1, r1, 64
+; AIX32-NEXT:    lwz r0, 8(r1)
+; AIX32-NEXT:    mtlr r0
+; AIX32-NEXT:    blr
+;
+; LINUX64LE-LABEL: print_func:
+; LINUX64LE:       # %bb.0: # %entry
+; LINUX64LE-NEXT:    mflr r0
+; LINUX64LE-NEXT:    .cfi_def_cfa_offset 48
+; LINUX64LE-NEXT:    .cfi_offset lr, 16
+; LINUX64LE-NEXT:    .cfi_offset r30, -16
+; LINUX64LE-NEXT:    std r30, -16(r1) # 8-byte Folded Spill
+; LINUX64LE-NEXT:    stdu r1, -48(r1)
+; LINUX64LE-NEXT:    addis r3, r2, .L__ModuleStringPool at toc@ha
+; LINUX64LE-NEXT:    std r0, 64(r1)
+; LINUX64LE-NEXT:    addi r30, r3, .L__ModuleStringPool at toc@l
+; LINUX64LE-NEXT:    mr r3, r30
+; LINUX64LE-NEXT:    bl puts
+; LINUX64LE-NEXT:    nop
+; LINUX64LE-NEXT:    addi r3, r30, 15
+; LINUX64LE-NEXT:    bl puts
+; LINUX64LE-NEXT:    nop
+; LINUX64LE-NEXT:    addi r1, r1, 48
+; LINUX64LE-NEXT:    ld r0, 16(r1)
+; LINUX64LE-NEXT:    ld r30, -16(r1) # 8-byte Folded Reload
+; LINUX64LE-NEXT:    mtlr r0
+; LINUX64LE-NEXT:    blr
+;
+; LINUX64BE-LABEL: print_func:
+; LINUX64BE:       # %bb.0: # %entry
+; LINUX64BE-NEXT:    mflr r0
+; LINUX64BE-NEXT:    stdu r1, -128(r1)
+; LINUX64BE-NEXT:    std r0, 144(r1)
+; LINUX64BE-NEXT:    .cfi_def_cfa_offset 128
+; LINUX64BE-NEXT:    .cfi_offset lr, 16
+; LINUX64BE-NEXT:    .cfi_offset r30, -16
+; LINUX64BE-NEXT:    addis r3, r2, .L__ModuleStringPool at toc@ha
+; LINUX64BE-NEXT:    std r30, 112(r1) # 8-byte Folded Spill
+; LINUX64BE-NEXT:    addi r30, r3, .L__ModuleStringPool at toc@l
+; LINUX64BE-NEXT:    mr r3, r30
+; LINUX64BE-NEXT:    bl puts
+; LINUX64BE-NEXT:    nop
+; LINUX64BE-NEXT:    addi r3, r30, 15
+; LINUX64BE-NEXT:    bl puts
+; LINUX64BE-NEXT:    nop
+; LINUX64BE-NEXT:    ld r30, 112(r1) # 8-byte Folded Reload
+; LINUX64BE-NEXT:    addi r1, r1, 128
+; LINUX64BE-NEXT:    ld r0, 16(r1)
+; LINUX64BE-NEXT:    mtlr r0
+; LINUX64BE-NEXT:    blr
+entry:
+  %call = tail call signext i32 @puts(ptr noundef nonnull dereferenceable(1) @.str)
+  %call1 = tail call signext i32 @puts(ptr noundef nonnull dereferenceable(1) @str)
+  ret void
+}


        


More information about the llvm-commits mailing list