[llvm] [PPC][AIX] Set needsFP to true when base pointer is used in prologue/… (PR #100182)
Zaara Syeda via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 29 13:31:01 PDT 2024
https://github.com/syzaara updated https://github.com/llvm/llvm-project/pull/100182
>From e5fd2aa95be1dc8ba62f2cbff925a5e9a59a1673 Mon Sep 17 00:00:00 2001
From: Zaara Syeda <syzaara at cpap8104.rtp.raleigh.ibm.com>
Date: Tue, 23 Jul 2024 13:24:09 -0400
Subject: [PATCH 1/2] [PPC][AIX] Set needsFP to true when base pointer is used
in prologue/epilogue
When the base pointer r30 is used to hold the stack pointer, r30 is spilled
in the prologue. On AIX registers are saved from highest to lowest, so r31
also needs to be saved. Setting needsFP to true on AIX when the base pointer
is used allows r31 to also be saved and restored.
---
llvm/lib/Target/PowerPC/PPCFrameLowering.cpp | 3 +
llvm/test/CodeGen/PowerPC/aix-base-pointer.ll | 13 +-
.../PowerPC/ppc64-rop-protection-aix.ll | 436 ++++++++++--------
3 files changed, 249 insertions(+), 203 deletions(-)
diff --git a/llvm/lib/Target/PowerPC/PPCFrameLowering.cpp b/llvm/lib/Target/PowerPC/PPCFrameLowering.cpp
index 1963582ce6863..11332dbd8147c 100644
--- a/llvm/lib/Target/PowerPC/PPCFrameLowering.cpp
+++ b/llvm/lib/Target/PowerPC/PPCFrameLowering.cpp
@@ -376,6 +376,9 @@ bool PPCFrameLowering::needsFP(const MachineFunction &MF) const {
if (MF.getFunction().hasFnAttribute(Attribute::Naked))
return false;
+ if (Subtarget.isAIXABI() && Subtarget.getRegisterInfo()->hasBasePointer(MF))
+ return true;
+
return MF.getTarget().Options.DisableFramePointerElim(MF) ||
MFI.hasVarSizedObjects() || MFI.hasStackMap() || MFI.hasPatchPoint() ||
MF.exposesReturnsTwice() ||
diff --git a/llvm/test/CodeGen/PowerPC/aix-base-pointer.ll b/llvm/test/CodeGen/PowerPC/aix-base-pointer.ll
index ab222d770360c..cc4f0ee92c5dc 100644
--- a/llvm/test/CodeGen/PowerPC/aix-base-pointer.ll
+++ b/llvm/test/CodeGen/PowerPC/aix-base-pointer.ll
@@ -6,8 +6,9 @@
; Use an overaligned buffer to force base-pointer usage. Test verifies:
; - base pointer register (r30) is saved/defined/restored.
+; - frame pointer register (r31) is saved/defined/restored.
; - stack frame is allocated with correct alignment.
-; - Address of %AlignedBuffer is calculated based off offset from the stack
+; - Address of %AlignedBuffer is calculated based off offset from the frame
; pointer.
define float @caller(float %f) {
@@ -19,23 +20,29 @@ define float @caller(float %f) {
declare void @callee(ptr)
; 32BIT-LABEL: .caller:
+; 32BIT: stw 31, -12(1)
; 32BIT: stw 30, -16(1)
; 32BIT: mr 30, 1
; 32BIT: clrlwi 0, 1, 27
; 32BIT: subfic 0, 0, -224
; 32BIT: stwux 1, 1, 0
-; 32BIT: addi 3, 1, 64
+; 32BIT: mr 31, 1
+; 32BIT: addi 3, 31, 64
; 32BIT: bl .callee
; 32BIT: mr 1, 30
+; 32BIT: lwz 31, -12(1)
; 32BIT: lwz 30, -16(1)
; 64BIT-LABEL: .caller:
+; 64BIT: std 31, -16(1)
; 64BIT: std 30, -24(1)
; 64BIT: mr 30, 1
; 64BIT: clrldi 0, 1, 59
; 64BIT: subfic 0, 0, -288
; 64BIT: stdux 1, 1, 0
-; 64BIT: addi 3, 1, 128
+; 64BIT: mr 31, 1
+; 64BIT: addi 3, 31, 128
; 64BIT: bl .callee
; 64BIT: mr 1, 30
+; 64BIT: ld 31, -16(1)
; 64BIT: ld 30, -24(1)
diff --git a/llvm/test/CodeGen/PowerPC/ppc64-rop-protection-aix.ll b/llvm/test/CodeGen/PowerPC/ppc64-rop-protection-aix.ll
index 8955835f41ea6..318b6d2fc6aa3 100644
--- a/llvm/test/CodeGen/PowerPC/ppc64-rop-protection-aix.ll
+++ b/llvm/test/CodeGen/PowerPC/ppc64-rop-protection-aix.ll
@@ -2297,510 +2297,546 @@ define dso_local zeroext i32 @aligned(ptr nocapture readonly %in) #0 {
; BE-P10-LABEL: aligned:
; BE-P10: # %bb.0: # %entry
; BE-P10-NEXT: mflr r0
+; BE-P10-NEXT: std r31, -8(r1)
; BE-P10-NEXT: std r30, -16(r1)
; BE-P10-NEXT: lis r12, -1
; BE-P10-NEXT: mr r30, r1
; BE-P10-NEXT: std r0, 16(r1)
-; BE-P10-NEXT: hashst r0, -24(r1)
+; BE-P10-NEXT: hashst r0, -32(r1)
; BE-P10-NEXT: clrldi r0, r1, 49
; BE-P10-NEXT: subc r0, r12, r0
; BE-P10-NEXT: stdux r1, r1, r0
-; BE-P10-NEXT: std r31, -8(r30) # 8-byte Folded Spill
-; BE-P10-NEXT: mr r31, r3
+; BE-P10-NEXT: std r29, -24(r30) # 8-byte Folded Spill
+; BE-P10-NEXT: mr r29, r3
; BE-P10-NEXT: lwz r3, 4(r3)
; BE-P10-NEXT: lis r4, 0
-; BE-P10-NEXT: addi r5, r1, 32764
-; BE-P10-NEXT: ori r4, r4, 65508
-; BE-P10-NEXT: stwx r3, r1, r4
-; BE-P10-NEXT: lwz r3, 12(r31)
+; BE-P10-NEXT: mr r31, r1
+; BE-P10-NEXT: ori r4, r4, 65500
+; BE-P10-NEXT: stwx r3, r31, r4
+; BE-P10-NEXT: lwz r3, 12(r29)
; BE-P10-NEXT: lis r4, 0
; BE-P10-NEXT: ori r4, r4, 32768
-; BE-P10-NEXT: stwx r3, r1, r4
-; BE-P10-NEXT: lwz r3, 20(r31)
+; BE-P10-NEXT: stwx r3, r31, r4
+; BE-P10-NEXT: lwz r3, 20(r29)
; BE-P10-NEXT: lis r4, 0
-; BE-P10-NEXT: ori r4, r4, 65508
-; BE-P10-NEXT: add r4, r1, r4
-; BE-P10-NEXT: stw r3, 32764(r1)
+; BE-P10-NEXT: ori r4, r4, 65500
+; BE-P10-NEXT: stw r3, 32764(r31)
; BE-P10-NEXT: lis r3, 0
; BE-P10-NEXT: ori r3, r3, 32768
-; BE-P10-NEXT: add r3, r1, r3
+; BE-P10-NEXT: add r3, r31, r3
+; BE-P10-NEXT: add r4, r31, r4
+; BE-P10-NEXT: addi r5, r31, 32764
; BE-P10-NEXT: bl .callee3[PR]
; BE-P10-NEXT: nop
-; BE-P10-NEXT: lwz r4, 16(r31)
-; BE-P10-NEXT: ld r31, -8(r30) # 8-byte Folded Reload
+; BE-P10-NEXT: lwz r4, 16(r29)
+; BE-P10-NEXT: ld r29, -24(r30) # 8-byte Folded Reload
; BE-P10-NEXT: add r3, r4, r3
; BE-P10-NEXT: clrldi r3, r3, 32
; BE-P10-NEXT: mr r1, r30
; BE-P10-NEXT: ld r0, 16(r1)
-; BE-P10-NEXT: ld r30, -16(r1)
+; BE-P10-NEXT: ld r31, -8(r1)
; BE-P10-NEXT: mtlr r0
-; BE-P10-NEXT: hashchk r0, -24(r1)
+; BE-P10-NEXT: ld r30, -16(r1)
+; BE-P10-NEXT: hashchk r0, -32(r1)
; BE-P10-NEXT: blr
;
; BE-P9-LABEL: aligned:
; BE-P9: # %bb.0: # %entry
; BE-P9-NEXT: mflr r0
-; BE-P9-NEXT: std r30, -16(r1)
+; BE-P9-NEXT: std r31, -8(r1)
; BE-P9-NEXT: lis r12, -1
+; BE-P9-NEXT: std r30, -16(r1)
; BE-P9-NEXT: mr r30, r1
; BE-P9-NEXT: std r0, 16(r1)
-; BE-P9-NEXT: hashst r0, -24(r1)
+; BE-P9-NEXT: hashst r0, -32(r1)
; BE-P9-NEXT: clrldi r0, r1, 49
; BE-P9-NEXT: subc r0, r12, r0
; BE-P9-NEXT: stdux r1, r1, r0
-; BE-P9-NEXT: std r31, -8(r30) # 8-byte Folded Spill
-; BE-P9-NEXT: mr r31, r3
+; BE-P9-NEXT: std r29, -24(r30) # 8-byte Folded Spill
+; BE-P9-NEXT: mr r29, r3
; BE-P9-NEXT: lwz r3, 4(r3)
; BE-P9-NEXT: lis r4, 0
-; BE-P9-NEXT: addi r5, r1, 32764
-; BE-P9-NEXT: ori r4, r4, 65508
-; BE-P9-NEXT: stwx r3, r1, r4
-; BE-P9-NEXT: lwz r3, 12(r31)
+; BE-P9-NEXT: mr r31, r1
+; BE-P9-NEXT: ori r4, r4, 65500
+; BE-P9-NEXT: addi r5, r31, 32764
+; BE-P9-NEXT: stwx r3, r31, r4
+; BE-P9-NEXT: lwz r3, 12(r29)
; BE-P9-NEXT: lis r4, 0
; BE-P9-NEXT: ori r4, r4, 32768
-; BE-P9-NEXT: stwx r3, r1, r4
-; BE-P9-NEXT: lwz r3, 20(r31)
+; BE-P9-NEXT: stwx r3, r31, r4
+; BE-P9-NEXT: lwz r3, 20(r29)
; BE-P9-NEXT: lis r4, 0
-; BE-P9-NEXT: ori r4, r4, 65508
-; BE-P9-NEXT: stw r3, 32764(r1)
+; BE-P9-NEXT: ori r4, r4, 65500
+; BE-P9-NEXT: stw r3, 32764(r31)
; BE-P9-NEXT: lis r3, 0
-; BE-P9-NEXT: add r4, r1, r4
+; BE-P9-NEXT: add r4, r31, r4
; BE-P9-NEXT: ori r3, r3, 32768
-; BE-P9-NEXT: add r3, r1, r3
+; BE-P9-NEXT: add r3, r31, r3
; BE-P9-NEXT: bl .callee3[PR]
; BE-P9-NEXT: nop
-; BE-P9-NEXT: lwz r4, 16(r31)
-; BE-P9-NEXT: ld r31, -8(r30) # 8-byte Folded Reload
+; BE-P9-NEXT: lwz r4, 16(r29)
+; BE-P9-NEXT: ld r29, -24(r30) # 8-byte Folded Reload
; BE-P9-NEXT: add r3, r4, r3
; BE-P9-NEXT: clrldi r3, r3, 32
; BE-P9-NEXT: mr r1, r30
; BE-P9-NEXT: ld r0, 16(r1)
+; BE-P9-NEXT: ld r31, -8(r1)
; BE-P9-NEXT: ld r30, -16(r1)
; BE-P9-NEXT: mtlr r0
-; BE-P9-NEXT: hashchk r0, -24(r1)
+; BE-P9-NEXT: hashchk r0, -32(r1)
; BE-P9-NEXT: blr
;
; BE-P8-LABEL: aligned:
; BE-P8: # %bb.0: # %entry
; BE-P8-NEXT: mflr r0
+; BE-P8-NEXT: std r31, -8(r1)
; BE-P8-NEXT: std r30, -16(r1)
; BE-P8-NEXT: lis r12, -1
; BE-P8-NEXT: mr r30, r1
; BE-P8-NEXT: std r0, 16(r1)
-; BE-P8-NEXT: hashst r0, -24(r1)
+; BE-P8-NEXT: hashst r0, -32(r1)
; BE-P8-NEXT: clrldi r0, r1, 49
; BE-P8-NEXT: subc r0, r12, r0
; BE-P8-NEXT: stdux r1, r1, r0
; BE-P8-NEXT: lis r4, 0
-; BE-P8-NEXT: std r31, -8(r30) # 8-byte Folded Spill
-; BE-P8-NEXT: mr r31, r3
+; BE-P8-NEXT: std r29, -24(r30) # 8-byte Folded Spill
+; BE-P8-NEXT: mr r29, r3
; BE-P8-NEXT: lwz r3, 4(r3)
-; BE-P8-NEXT: addi r5, r1, 32764
-; BE-P8-NEXT: ori r4, r4, 65508
-; BE-P8-NEXT: stwx r3, r1, r4
+; BE-P8-NEXT: mr r31, r1
+; BE-P8-NEXT: ori r4, r4, 65500
+; BE-P8-NEXT: addi r5, r31, 32764
+; BE-P8-NEXT: stwx r3, r31, r4
; BE-P8-NEXT: lis r4, 0
-; BE-P8-NEXT: lwz r3, 12(r31)
+; BE-P8-NEXT: lwz r3, 12(r29)
; BE-P8-NEXT: ori r4, r4, 32768
-; BE-P8-NEXT: stwx r3, r1, r4
-; BE-P8-NEXT: lwz r3, 20(r31)
+; BE-P8-NEXT: stwx r3, r31, r4
+; BE-P8-NEXT: lwz r3, 20(r29)
; BE-P8-NEXT: lis r4, 0
-; BE-P8-NEXT: ori r4, r4, 65508
-; BE-P8-NEXT: stw r3, 32764(r1)
+; BE-P8-NEXT: ori r4, r4, 65500
+; BE-P8-NEXT: stw r3, 32764(r31)
; BE-P8-NEXT: lis r3, 0
-; BE-P8-NEXT: add r4, r1, r4
+; BE-P8-NEXT: add r4, r31, r4
; BE-P8-NEXT: ori r3, r3, 32768
-; BE-P8-NEXT: add r3, r1, r3
+; BE-P8-NEXT: add r3, r31, r3
; BE-P8-NEXT: bl .callee3[PR]
; BE-P8-NEXT: nop
-; BE-P8-NEXT: lwz r4, 16(r31)
-; BE-P8-NEXT: ld r31, -8(r30) # 8-byte Folded Reload
+; BE-P8-NEXT: lwz r4, 16(r29)
+; BE-P8-NEXT: ld r29, -24(r30) # 8-byte Folded Reload
; BE-P8-NEXT: add r3, r4, r3
; BE-P8-NEXT: clrldi r3, r3, 32
; BE-P8-NEXT: mr r1, r30
; BE-P8-NEXT: ld r0, 16(r1)
+; BE-P8-NEXT: ld r31, -8(r1)
; BE-P8-NEXT: ld r30, -16(r1)
-; BE-P8-NEXT: hashchk r0, -24(r1)
+; BE-P8-NEXT: hashchk r0, -32(r1)
; BE-P8-NEXT: mtlr r0
; BE-P8-NEXT: blr
;
; BE-32BIT-P10-LABEL: aligned:
; BE-32BIT-P10: # %bb.0: # %entry
; BE-32BIT-P10-NEXT: mflr r0
+; BE-32BIT-P10-NEXT: stw r31, -4(r1)
; BE-32BIT-P10-NEXT: stw r30, -8(r1)
; BE-32BIT-P10-NEXT: lis r12, -1
; BE-32BIT-P10-NEXT: mr r30, r1
; BE-32BIT-P10-NEXT: stw r0, 8(r1)
-; BE-32BIT-P10-NEXT: hashst r0, -16(r1)
+; BE-32BIT-P10-NEXT: hashst r0, -24(r1)
; BE-32BIT-P10-NEXT: clrlwi r0, r1, 17
; BE-32BIT-P10-NEXT: subc r0, r12, r0
; BE-32BIT-P10-NEXT: stwux r1, r1, r0
-; BE-32BIT-P10-NEXT: stw r31, -4(r30) # 4-byte Folded Spill
-; BE-32BIT-P10-NEXT: mr r31, r3
+; BE-32BIT-P10-NEXT: stw r29, -12(r30) # 4-byte Folded Spill
+; BE-32BIT-P10-NEXT: mr r29, r3
; BE-32BIT-P10-NEXT: lwz r3, 4(r3)
; BE-32BIT-P10-NEXT: lis r4, 0
-; BE-32BIT-P10-NEXT: addi r5, r1, 32764
-; BE-32BIT-P10-NEXT: ori r4, r4, 65516
-; BE-32BIT-P10-NEXT: stwx r3, r1, r4
-; BE-32BIT-P10-NEXT: lwz r3, 12(r31)
+; BE-32BIT-P10-NEXT: mr r31, r1
+; BE-32BIT-P10-NEXT: ori r4, r4, 65508
+; BE-32BIT-P10-NEXT: stwx r3, r31, r4
+; BE-32BIT-P10-NEXT: lwz r3, 12(r29)
; BE-32BIT-P10-NEXT: lis r4, 0
; BE-32BIT-P10-NEXT: ori r4, r4, 32768
-; BE-32BIT-P10-NEXT: stwx r3, r1, r4
-; BE-32BIT-P10-NEXT: lwz r3, 20(r31)
+; BE-32BIT-P10-NEXT: stwx r3, r31, r4
+; BE-32BIT-P10-NEXT: lwz r3, 20(r29)
; BE-32BIT-P10-NEXT: lis r4, 0
-; BE-32BIT-P10-NEXT: ori r4, r4, 65516
-; BE-32BIT-P10-NEXT: add r4, r1, r4
-; BE-32BIT-P10-NEXT: stw r3, 32764(r1)
+; BE-32BIT-P10-NEXT: ori r4, r4, 65508
+; BE-32BIT-P10-NEXT: stw r3, 32764(r31)
; BE-32BIT-P10-NEXT: lis r3, 0
; BE-32BIT-P10-NEXT: ori r3, r3, 32768
-; BE-32BIT-P10-NEXT: add r3, r1, r3
+; BE-32BIT-P10-NEXT: add r3, r31, r3
+; BE-32BIT-P10-NEXT: add r4, r31, r4
+; BE-32BIT-P10-NEXT: addi r5, r31, 32764
; BE-32BIT-P10-NEXT: bl .callee3[PR]
; BE-32BIT-P10-NEXT: nop
-; BE-32BIT-P10-NEXT: lwz r4, 16(r31)
-; BE-32BIT-P10-NEXT: lwz r31, -4(r30) # 4-byte Folded Reload
+; BE-32BIT-P10-NEXT: lwz r4, 16(r29)
+; BE-32BIT-P10-NEXT: lwz r29, -12(r30) # 4-byte Folded Reload
; BE-32BIT-P10-NEXT: add r3, r4, r3
; BE-32BIT-P10-NEXT: mr r1, r30
; BE-32BIT-P10-NEXT: lwz r0, 8(r1)
-; BE-32BIT-P10-NEXT: lwz r30, -8(r1)
+; BE-32BIT-P10-NEXT: lwz r31, -4(r1)
; BE-32BIT-P10-NEXT: mtlr r0
-; BE-32BIT-P10-NEXT: hashchk r0, -16(r1)
+; BE-32BIT-P10-NEXT: lwz r30, -8(r1)
+; BE-32BIT-P10-NEXT: hashchk r0, -24(r1)
; BE-32BIT-P10-NEXT: blr
;
; BE-32BIT-P9-LABEL: aligned:
; BE-32BIT-P9: # %bb.0: # %entry
; BE-32BIT-P9-NEXT: mflr r0
-; BE-32BIT-P9-NEXT: stw r30, -8(r1)
+; BE-32BIT-P9-NEXT: stw r31, -4(r1)
; BE-32BIT-P9-NEXT: lis r12, -1
+; BE-32BIT-P9-NEXT: stw r30, -8(r1)
; BE-32BIT-P9-NEXT: mr r30, r1
; BE-32BIT-P9-NEXT: stw r0, 8(r1)
-; BE-32BIT-P9-NEXT: hashst r0, -16(r1)
+; BE-32BIT-P9-NEXT: hashst r0, -24(r1)
; BE-32BIT-P9-NEXT: clrlwi r0, r1, 17
; BE-32BIT-P9-NEXT: subc r0, r12, r0
; BE-32BIT-P9-NEXT: stwux r1, r1, r0
-; BE-32BIT-P9-NEXT: stw r31, -4(r30) # 4-byte Folded Spill
-; BE-32BIT-P9-NEXT: mr r31, r3
+; BE-32BIT-P9-NEXT: stw r29, -12(r30) # 4-byte Folded Spill
+; BE-32BIT-P9-NEXT: mr r29, r3
; BE-32BIT-P9-NEXT: lwz r3, 4(r3)
; BE-32BIT-P9-NEXT: lis r4, 0
-; BE-32BIT-P9-NEXT: addi r5, r1, 32764
-; BE-32BIT-P9-NEXT: ori r4, r4, 65516
-; BE-32BIT-P9-NEXT: stwx r3, r1, r4
-; BE-32BIT-P9-NEXT: lwz r3, 12(r31)
+; BE-32BIT-P9-NEXT: mr r31, r1
+; BE-32BIT-P9-NEXT: ori r4, r4, 65508
+; BE-32BIT-P9-NEXT: addi r5, r31, 32764
+; BE-32BIT-P9-NEXT: stwx r3, r31, r4
+; BE-32BIT-P9-NEXT: lwz r3, 12(r29)
; BE-32BIT-P9-NEXT: lis r4, 0
; BE-32BIT-P9-NEXT: ori r4, r4, 32768
-; BE-32BIT-P9-NEXT: stwx r3, r1, r4
-; BE-32BIT-P9-NEXT: lwz r3, 20(r31)
+; BE-32BIT-P9-NEXT: stwx r3, r31, r4
+; BE-32BIT-P9-NEXT: lwz r3, 20(r29)
; BE-32BIT-P9-NEXT: lis r4, 0
-; BE-32BIT-P9-NEXT: ori r4, r4, 65516
-; BE-32BIT-P9-NEXT: stw r3, 32764(r1)
+; BE-32BIT-P9-NEXT: ori r4, r4, 65508
+; BE-32BIT-P9-NEXT: stw r3, 32764(r31)
; BE-32BIT-P9-NEXT: lis r3, 0
-; BE-32BIT-P9-NEXT: add r4, r1, r4
+; BE-32BIT-P9-NEXT: add r4, r31, r4
; BE-32BIT-P9-NEXT: ori r3, r3, 32768
-; BE-32BIT-P9-NEXT: add r3, r1, r3
+; BE-32BIT-P9-NEXT: add r3, r31, r3
; BE-32BIT-P9-NEXT: bl .callee3[PR]
; BE-32BIT-P9-NEXT: nop
-; BE-32BIT-P9-NEXT: lwz r4, 16(r31)
-; BE-32BIT-P9-NEXT: lwz r31, -4(r30) # 4-byte Folded Reload
+; BE-32BIT-P9-NEXT: lwz r4, 16(r29)
+; BE-32BIT-P9-NEXT: lwz r29, -12(r30) # 4-byte Folded Reload
; BE-32BIT-P9-NEXT: add r3, r4, r3
; BE-32BIT-P9-NEXT: mr r1, r30
; BE-32BIT-P9-NEXT: lwz r0, 8(r1)
+; BE-32BIT-P9-NEXT: lwz r31, -4(r1)
; BE-32BIT-P9-NEXT: lwz r30, -8(r1)
; BE-32BIT-P9-NEXT: mtlr r0
-; BE-32BIT-P9-NEXT: hashchk r0, -16(r1)
+; BE-32BIT-P9-NEXT: hashchk r0, -24(r1)
; BE-32BIT-P9-NEXT: blr
;
; BE-32BIT-P8-LABEL: aligned:
; BE-32BIT-P8: # %bb.0: # %entry
; BE-32BIT-P8-NEXT: mflr r0
+; BE-32BIT-P8-NEXT: stw r31, -4(r1)
; BE-32BIT-P8-NEXT: stw r30, -8(r1)
; BE-32BIT-P8-NEXT: lis r12, -1
; BE-32BIT-P8-NEXT: mr r30, r1
; BE-32BIT-P8-NEXT: stw r0, 8(r1)
-; BE-32BIT-P8-NEXT: hashst r0, -16(r1)
+; BE-32BIT-P8-NEXT: hashst r0, -24(r1)
; BE-32BIT-P8-NEXT: clrlwi r0, r1, 17
; BE-32BIT-P8-NEXT: subc r0, r12, r0
; BE-32BIT-P8-NEXT: stwux r1, r1, r0
; BE-32BIT-P8-NEXT: lis r4, 0
-; BE-32BIT-P8-NEXT: stw r31, -4(r30) # 4-byte Folded Spill
-; BE-32BIT-P8-NEXT: mr r31, r3
+; BE-32BIT-P8-NEXT: stw r29, -12(r30) # 4-byte Folded Spill
+; BE-32BIT-P8-NEXT: mr r29, r3
; BE-32BIT-P8-NEXT: lwz r3, 4(r3)
-; BE-32BIT-P8-NEXT: addi r5, r1, 32764
-; BE-32BIT-P8-NEXT: ori r4, r4, 65516
-; BE-32BIT-P8-NEXT: stwx r3, r1, r4
+; BE-32BIT-P8-NEXT: mr r31, r1
+; BE-32BIT-P8-NEXT: ori r4, r4, 65508
+; BE-32BIT-P8-NEXT: addi r5, r31, 32764
+; BE-32BIT-P8-NEXT: stwx r3, r31, r4
; BE-32BIT-P8-NEXT: lis r4, 0
-; BE-32BIT-P8-NEXT: lwz r3, 12(r31)
+; BE-32BIT-P8-NEXT: lwz r3, 12(r29)
; BE-32BIT-P8-NEXT: ori r4, r4, 32768
-; BE-32BIT-P8-NEXT: stwx r3, r1, r4
-; BE-32BIT-P8-NEXT: lwz r3, 20(r31)
+; BE-32BIT-P8-NEXT: stwx r3, r31, r4
+; BE-32BIT-P8-NEXT: lwz r3, 20(r29)
; BE-32BIT-P8-NEXT: lis r4, 0
-; BE-32BIT-P8-NEXT: ori r4, r4, 65516
-; BE-32BIT-P8-NEXT: stw r3, 32764(r1)
+; BE-32BIT-P8-NEXT: ori r4, r4, 65508
+; BE-32BIT-P8-NEXT: stw r3, 32764(r31)
; BE-32BIT-P8-NEXT: lis r3, 0
-; BE-32BIT-P8-NEXT: add r4, r1, r4
+; BE-32BIT-P8-NEXT: add r4, r31, r4
; BE-32BIT-P8-NEXT: ori r3, r3, 32768
-; BE-32BIT-P8-NEXT: add r3, r1, r3
+; BE-32BIT-P8-NEXT: add r3, r31, r3
; BE-32BIT-P8-NEXT: bl .callee3[PR]
; BE-32BIT-P8-NEXT: nop
-; BE-32BIT-P8-NEXT: lwz r4, 16(r31)
-; BE-32BIT-P8-NEXT: lwz r31, -4(r30) # 4-byte Folded Reload
+; BE-32BIT-P8-NEXT: lwz r4, 16(r29)
+; BE-32BIT-P8-NEXT: lwz r29, -12(r30) # 4-byte Folded Reload
; BE-32BIT-P8-NEXT: add r3, r4, r3
; BE-32BIT-P8-NEXT: mr r1, r30
; BE-32BIT-P8-NEXT: lwz r0, 8(r1)
+; BE-32BIT-P8-NEXT: lwz r31, -4(r1)
; BE-32BIT-P8-NEXT: lwz r30, -8(r1)
-; BE-32BIT-P8-NEXT: hashchk r0, -16(r1)
+; BE-32BIT-P8-NEXT: hashchk r0, -24(r1)
; BE-32BIT-P8-NEXT: mtlr r0
; BE-32BIT-P8-NEXT: blr
;
; BE-P10-PRIV-LABEL: aligned:
; BE-P10-PRIV: # %bb.0: # %entry
; BE-P10-PRIV-NEXT: mflr r0
+; BE-P10-PRIV-NEXT: std r31, -8(r1)
; BE-P10-PRIV-NEXT: std r30, -16(r1)
; BE-P10-PRIV-NEXT: lis r12, -1
; BE-P10-PRIV-NEXT: mr r30, r1
; BE-P10-PRIV-NEXT: std r0, 16(r1)
-; BE-P10-PRIV-NEXT: hashstp r0, -24(r1)
+; BE-P10-PRIV-NEXT: hashstp r0, -32(r1)
; BE-P10-PRIV-NEXT: clrldi r0, r1, 49
; BE-P10-PRIV-NEXT: subc r0, r12, r0
; BE-P10-PRIV-NEXT: stdux r1, r1, r0
-; BE-P10-PRIV-NEXT: std r31, -8(r30) # 8-byte Folded Spill
-; BE-P10-PRIV-NEXT: mr r31, r3
+; BE-P10-PRIV-NEXT: std r29, -24(r30) # 8-byte Folded Spill
+; BE-P10-PRIV-NEXT: mr r29, r3
; BE-P10-PRIV-NEXT: lwz r3, 4(r3)
; BE-P10-PRIV-NEXT: lis r4, 0
-; BE-P10-PRIV-NEXT: addi r5, r1, 32764
-; BE-P10-PRIV-NEXT: ori r4, r4, 65508
-; BE-P10-PRIV-NEXT: stwx r3, r1, r4
-; BE-P10-PRIV-NEXT: lwz r3, 12(r31)
+; BE-P10-PRIV-NEXT: mr r31, r1
+; BE-P10-PRIV-NEXT: ori r4, r4, 65500
+; BE-P10-PRIV-NEXT: stwx r3, r31, r4
+; BE-P10-PRIV-NEXT: lwz r3, 12(r29)
; BE-P10-PRIV-NEXT: lis r4, 0
; BE-P10-PRIV-NEXT: ori r4, r4, 32768
-; BE-P10-PRIV-NEXT: stwx r3, r1, r4
-; BE-P10-PRIV-NEXT: lwz r3, 20(r31)
+; BE-P10-PRIV-NEXT: stwx r3, r31, r4
+; BE-P10-PRIV-NEXT: lwz r3, 20(r29)
; BE-P10-PRIV-NEXT: lis r4, 0
-; BE-P10-PRIV-NEXT: ori r4, r4, 65508
-; BE-P10-PRIV-NEXT: add r4, r1, r4
-; BE-P10-PRIV-NEXT: stw r3, 32764(r1)
+; BE-P10-PRIV-NEXT: ori r4, r4, 65500
+; BE-P10-PRIV-NEXT: stw r3, 32764(r31)
; BE-P10-PRIV-NEXT: lis r3, 0
; BE-P10-PRIV-NEXT: ori r3, r3, 32768
-; BE-P10-PRIV-NEXT: add r3, r1, r3
+; BE-P10-PRIV-NEXT: add r3, r31, r3
+; BE-P10-PRIV-NEXT: add r4, r31, r4
+; BE-P10-PRIV-NEXT: addi r5, r31, 32764
; BE-P10-PRIV-NEXT: bl .callee3[PR]
; BE-P10-PRIV-NEXT: nop
-; BE-P10-PRIV-NEXT: lwz r4, 16(r31)
-; BE-P10-PRIV-NEXT: ld r31, -8(r30) # 8-byte Folded Reload
+; BE-P10-PRIV-NEXT: lwz r4, 16(r29)
+; BE-P10-PRIV-NEXT: ld r29, -24(r30) # 8-byte Folded Reload
; BE-P10-PRIV-NEXT: add r3, r4, r3
; BE-P10-PRIV-NEXT: clrldi r3, r3, 32
; BE-P10-PRIV-NEXT: mr r1, r30
; BE-P10-PRIV-NEXT: ld r0, 16(r1)
-; BE-P10-PRIV-NEXT: ld r30, -16(r1)
+; BE-P10-PRIV-NEXT: ld r31, -8(r1)
; BE-P10-PRIV-NEXT: mtlr r0
-; BE-P10-PRIV-NEXT: hashchkp r0, -24(r1)
+; BE-P10-PRIV-NEXT: ld r30, -16(r1)
+; BE-P10-PRIV-NEXT: hashchkp r0, -32(r1)
; BE-P10-PRIV-NEXT: blr
;
; BE-P9-PRIV-LABEL: aligned:
; BE-P9-PRIV: # %bb.0: # %entry
; BE-P9-PRIV-NEXT: mflr r0
-; BE-P9-PRIV-NEXT: std r30, -16(r1)
+; BE-P9-PRIV-NEXT: std r31, -8(r1)
; BE-P9-PRIV-NEXT: lis r12, -1
+; BE-P9-PRIV-NEXT: std r30, -16(r1)
; BE-P9-PRIV-NEXT: mr r30, r1
; BE-P9-PRIV-NEXT: std r0, 16(r1)
-; BE-P9-PRIV-NEXT: hashstp r0, -24(r1)
+; BE-P9-PRIV-NEXT: hashstp r0, -32(r1)
; BE-P9-PRIV-NEXT: clrldi r0, r1, 49
; BE-P9-PRIV-NEXT: subc r0, r12, r0
; BE-P9-PRIV-NEXT: stdux r1, r1, r0
-; BE-P9-PRIV-NEXT: std r31, -8(r30) # 8-byte Folded Spill
-; BE-P9-PRIV-NEXT: mr r31, r3
+; BE-P9-PRIV-NEXT: std r29, -24(r30) # 8-byte Folded Spill
+; BE-P9-PRIV-NEXT: mr r29, r3
; BE-P9-PRIV-NEXT: lwz r3, 4(r3)
; BE-P9-PRIV-NEXT: lis r4, 0
-; BE-P9-PRIV-NEXT: addi r5, r1, 32764
-; BE-P9-PRIV-NEXT: ori r4, r4, 65508
-; BE-P9-PRIV-NEXT: stwx r3, r1, r4
-; BE-P9-PRIV-NEXT: lwz r3, 12(r31)
+; BE-P9-PRIV-NEXT: mr r31, r1
+; BE-P9-PRIV-NEXT: ori r4, r4, 65500
+; BE-P9-PRIV-NEXT: addi r5, r31, 32764
+; BE-P9-PRIV-NEXT: stwx r3, r31, r4
+; BE-P9-PRIV-NEXT: lwz r3, 12(r29)
; BE-P9-PRIV-NEXT: lis r4, 0
; BE-P9-PRIV-NEXT: ori r4, r4, 32768
-; BE-P9-PRIV-NEXT: stwx r3, r1, r4
-; BE-P9-PRIV-NEXT: lwz r3, 20(r31)
+; BE-P9-PRIV-NEXT: stwx r3, r31, r4
+; BE-P9-PRIV-NEXT: lwz r3, 20(r29)
; BE-P9-PRIV-NEXT: lis r4, 0
-; BE-P9-PRIV-NEXT: ori r4, r4, 65508
-; BE-P9-PRIV-NEXT: stw r3, 32764(r1)
+; BE-P9-PRIV-NEXT: ori r4, r4, 65500
+; BE-P9-PRIV-NEXT: stw r3, 32764(r31)
; BE-P9-PRIV-NEXT: lis r3, 0
-; BE-P9-PRIV-NEXT: add r4, r1, r4
+; BE-P9-PRIV-NEXT: add r4, r31, r4
; BE-P9-PRIV-NEXT: ori r3, r3, 32768
-; BE-P9-PRIV-NEXT: add r3, r1, r3
+; BE-P9-PRIV-NEXT: add r3, r31, r3
; BE-P9-PRIV-NEXT: bl .callee3[PR]
; BE-P9-PRIV-NEXT: nop
-; BE-P9-PRIV-NEXT: lwz r4, 16(r31)
-; BE-P9-PRIV-NEXT: ld r31, -8(r30) # 8-byte Folded Reload
+; BE-P9-PRIV-NEXT: lwz r4, 16(r29)
+; BE-P9-PRIV-NEXT: ld r29, -24(r30) # 8-byte Folded Reload
; BE-P9-PRIV-NEXT: add r3, r4, r3
; BE-P9-PRIV-NEXT: clrldi r3, r3, 32
; BE-P9-PRIV-NEXT: mr r1, r30
; BE-P9-PRIV-NEXT: ld r0, 16(r1)
+; BE-P9-PRIV-NEXT: ld r31, -8(r1)
; BE-P9-PRIV-NEXT: ld r30, -16(r1)
; BE-P9-PRIV-NEXT: mtlr r0
-; BE-P9-PRIV-NEXT: hashchkp r0, -24(r1)
+; BE-P9-PRIV-NEXT: hashchkp r0, -32(r1)
; BE-P9-PRIV-NEXT: blr
;
; BE-P8-PRIV-LABEL: aligned:
; BE-P8-PRIV: # %bb.0: # %entry
; BE-P8-PRIV-NEXT: mflr r0
+; BE-P8-PRIV-NEXT: std r31, -8(r1)
; BE-P8-PRIV-NEXT: std r30, -16(r1)
; BE-P8-PRIV-NEXT: lis r12, -1
; BE-P8-PRIV-NEXT: mr r30, r1
; BE-P8-PRIV-NEXT: std r0, 16(r1)
-; BE-P8-PRIV-NEXT: hashstp r0, -24(r1)
+; BE-P8-PRIV-NEXT: hashstp r0, -32(r1)
; BE-P8-PRIV-NEXT: clrldi r0, r1, 49
; BE-P8-PRIV-NEXT: subc r0, r12, r0
; BE-P8-PRIV-NEXT: stdux r1, r1, r0
; BE-P8-PRIV-NEXT: lis r4, 0
-; BE-P8-PRIV-NEXT: std r31, -8(r30) # 8-byte Folded Spill
-; BE-P8-PRIV-NEXT: mr r31, r3
+; BE-P8-PRIV-NEXT: std r29, -24(r30) # 8-byte Folded Spill
+; BE-P8-PRIV-NEXT: mr r29, r3
; BE-P8-PRIV-NEXT: lwz r3, 4(r3)
-; BE-P8-PRIV-NEXT: addi r5, r1, 32764
-; BE-P8-PRIV-NEXT: ori r4, r4, 65508
-; BE-P8-PRIV-NEXT: stwx r3, r1, r4
+; BE-P8-PRIV-NEXT: mr r31, r1
+; BE-P8-PRIV-NEXT: ori r4, r4, 65500
+; BE-P8-PRIV-NEXT: addi r5, r31, 32764
+; BE-P8-PRIV-NEXT: stwx r3, r31, r4
; BE-P8-PRIV-NEXT: lis r4, 0
-; BE-P8-PRIV-NEXT: lwz r3, 12(r31)
+; BE-P8-PRIV-NEXT: lwz r3, 12(r29)
; BE-P8-PRIV-NEXT: ori r4, r4, 32768
-; BE-P8-PRIV-NEXT: stwx r3, r1, r4
-; BE-P8-PRIV-NEXT: lwz r3, 20(r31)
+; BE-P8-PRIV-NEXT: stwx r3, r31, r4
+; BE-P8-PRIV-NEXT: lwz r3, 20(r29)
; BE-P8-PRIV-NEXT: lis r4, 0
-; BE-P8-PRIV-NEXT: ori r4, r4, 65508
-; BE-P8-PRIV-NEXT: stw r3, 32764(r1)
+; BE-P8-PRIV-NEXT: ori r4, r4, 65500
+; BE-P8-PRIV-NEXT: stw r3, 32764(r31)
; BE-P8-PRIV-NEXT: lis r3, 0
-; BE-P8-PRIV-NEXT: add r4, r1, r4
+; BE-P8-PRIV-NEXT: add r4, r31, r4
; BE-P8-PRIV-NEXT: ori r3, r3, 32768
-; BE-P8-PRIV-NEXT: add r3, r1, r3
+; BE-P8-PRIV-NEXT: add r3, r31, r3
; BE-P8-PRIV-NEXT: bl .callee3[PR]
; BE-P8-PRIV-NEXT: nop
-; BE-P8-PRIV-NEXT: lwz r4, 16(r31)
-; BE-P8-PRIV-NEXT: ld r31, -8(r30) # 8-byte Folded Reload
+; BE-P8-PRIV-NEXT: lwz r4, 16(r29)
+; BE-P8-PRIV-NEXT: ld r29, -24(r30) # 8-byte Folded Reload
; BE-P8-PRIV-NEXT: add r3, r4, r3
; BE-P8-PRIV-NEXT: clrldi r3, r3, 32
; BE-P8-PRIV-NEXT: mr r1, r30
; BE-P8-PRIV-NEXT: ld r0, 16(r1)
+; BE-P8-PRIV-NEXT: ld r31, -8(r1)
; BE-P8-PRIV-NEXT: ld r30, -16(r1)
-; BE-P8-PRIV-NEXT: hashchkp r0, -24(r1)
+; BE-P8-PRIV-NEXT: hashchkp r0, -32(r1)
; BE-P8-PRIV-NEXT: mtlr r0
; BE-P8-PRIV-NEXT: blr
;
; BE-32BIT-P10-PRIV-LABEL: aligned:
; BE-32BIT-P10-PRIV: # %bb.0: # %entry
; BE-32BIT-P10-PRIV-NEXT: mflr r0
+; BE-32BIT-P10-PRIV-NEXT: stw r31, -4(r1)
; BE-32BIT-P10-PRIV-NEXT: stw r30, -8(r1)
; BE-32BIT-P10-PRIV-NEXT: lis r12, -1
; BE-32BIT-P10-PRIV-NEXT: mr r30, r1
; BE-32BIT-P10-PRIV-NEXT: stw r0, 8(r1)
-; BE-32BIT-P10-PRIV-NEXT: hashstp r0, -16(r1)
+; BE-32BIT-P10-PRIV-NEXT: hashstp r0, -24(r1)
; BE-32BIT-P10-PRIV-NEXT: clrlwi r0, r1, 17
; BE-32BIT-P10-PRIV-NEXT: subc r0, r12, r0
; BE-32BIT-P10-PRIV-NEXT: stwux r1, r1, r0
-; BE-32BIT-P10-PRIV-NEXT: stw r31, -4(r30) # 4-byte Folded Spill
-; BE-32BIT-P10-PRIV-NEXT: mr r31, r3
+; BE-32BIT-P10-PRIV-NEXT: stw r29, -12(r30) # 4-byte Folded Spill
+; BE-32BIT-P10-PRIV-NEXT: mr r29, r3
; BE-32BIT-P10-PRIV-NEXT: lwz r3, 4(r3)
; BE-32BIT-P10-PRIV-NEXT: lis r4, 0
-; BE-32BIT-P10-PRIV-NEXT: addi r5, r1, 32764
-; BE-32BIT-P10-PRIV-NEXT: ori r4, r4, 65516
-; BE-32BIT-P10-PRIV-NEXT: stwx r3, r1, r4
-; BE-32BIT-P10-PRIV-NEXT: lwz r3, 12(r31)
+; BE-32BIT-P10-PRIV-NEXT: mr r31, r1
+; BE-32BIT-P10-PRIV-NEXT: ori r4, r4, 65508
+; BE-32BIT-P10-PRIV-NEXT: stwx r3, r31, r4
+; BE-32BIT-P10-PRIV-NEXT: lwz r3, 12(r29)
; BE-32BIT-P10-PRIV-NEXT: lis r4, 0
; BE-32BIT-P10-PRIV-NEXT: ori r4, r4, 32768
-; BE-32BIT-P10-PRIV-NEXT: stwx r3, r1, r4
-; BE-32BIT-P10-PRIV-NEXT: lwz r3, 20(r31)
+; BE-32BIT-P10-PRIV-NEXT: stwx r3, r31, r4
+; BE-32BIT-P10-PRIV-NEXT: lwz r3, 20(r29)
; BE-32BIT-P10-PRIV-NEXT: lis r4, 0
-; BE-32BIT-P10-PRIV-NEXT: ori r4, r4, 65516
-; BE-32BIT-P10-PRIV-NEXT: add r4, r1, r4
-; BE-32BIT-P10-PRIV-NEXT: stw r3, 32764(r1)
+; BE-32BIT-P10-PRIV-NEXT: ori r4, r4, 65508
+; BE-32BIT-P10-PRIV-NEXT: stw r3, 32764(r31)
; BE-32BIT-P10-PRIV-NEXT: lis r3, 0
; BE-32BIT-P10-PRIV-NEXT: ori r3, r3, 32768
-; BE-32BIT-P10-PRIV-NEXT: add r3, r1, r3
+; BE-32BIT-P10-PRIV-NEXT: add r3, r31, r3
+; BE-32BIT-P10-PRIV-NEXT: add r4, r31, r4
+; BE-32BIT-P10-PRIV-NEXT: addi r5, r31, 32764
; BE-32BIT-P10-PRIV-NEXT: bl .callee3[PR]
; BE-32BIT-P10-PRIV-NEXT: nop
-; BE-32BIT-P10-PRIV-NEXT: lwz r4, 16(r31)
-; BE-32BIT-P10-PRIV-NEXT: lwz r31, -4(r30) # 4-byte Folded Reload
+; BE-32BIT-P10-PRIV-NEXT: lwz r4, 16(r29)
+; BE-32BIT-P10-PRIV-NEXT: lwz r29, -12(r30) # 4-byte Folded Reload
; BE-32BIT-P10-PRIV-NEXT: add r3, r4, r3
; BE-32BIT-P10-PRIV-NEXT: mr r1, r30
; BE-32BIT-P10-PRIV-NEXT: lwz r0, 8(r1)
-; BE-32BIT-P10-PRIV-NEXT: lwz r30, -8(r1)
+; BE-32BIT-P10-PRIV-NEXT: lwz r31, -4(r1)
; BE-32BIT-P10-PRIV-NEXT: mtlr r0
-; BE-32BIT-P10-PRIV-NEXT: hashchkp r0, -16(r1)
+; BE-32BIT-P10-PRIV-NEXT: lwz r30, -8(r1)
+; BE-32BIT-P10-PRIV-NEXT: hashchkp r0, -24(r1)
; BE-32BIT-P10-PRIV-NEXT: blr
;
; BE-32BIT-P9-PRIV-LABEL: aligned:
; BE-32BIT-P9-PRIV: # %bb.0: # %entry
; BE-32BIT-P9-PRIV-NEXT: mflr r0
-; BE-32BIT-P9-PRIV-NEXT: stw r30, -8(r1)
+; BE-32BIT-P9-PRIV-NEXT: stw r31, -4(r1)
; BE-32BIT-P9-PRIV-NEXT: lis r12, -1
+; BE-32BIT-P9-PRIV-NEXT: stw r30, -8(r1)
; BE-32BIT-P9-PRIV-NEXT: mr r30, r1
; BE-32BIT-P9-PRIV-NEXT: stw r0, 8(r1)
-; BE-32BIT-P9-PRIV-NEXT: hashstp r0, -16(r1)
+; BE-32BIT-P9-PRIV-NEXT: hashstp r0, -24(r1)
; BE-32BIT-P9-PRIV-NEXT: clrlwi r0, r1, 17
; BE-32BIT-P9-PRIV-NEXT: subc r0, r12, r0
; BE-32BIT-P9-PRIV-NEXT: stwux r1, r1, r0
-; BE-32BIT-P9-PRIV-NEXT: stw r31, -4(r30) # 4-byte Folded Spill
-; BE-32BIT-P9-PRIV-NEXT: mr r31, r3
+; BE-32BIT-P9-PRIV-NEXT: stw r29, -12(r30) # 4-byte Folded Spill
+; BE-32BIT-P9-PRIV-NEXT: mr r29, r3
; BE-32BIT-P9-PRIV-NEXT: lwz r3, 4(r3)
; BE-32BIT-P9-PRIV-NEXT: lis r4, 0
-; BE-32BIT-P9-PRIV-NEXT: addi r5, r1, 32764
-; BE-32BIT-P9-PRIV-NEXT: ori r4, r4, 65516
-; BE-32BIT-P9-PRIV-NEXT: stwx r3, r1, r4
-; BE-32BIT-P9-PRIV-NEXT: lwz r3, 12(r31)
+; BE-32BIT-P9-PRIV-NEXT: mr r31, r1
+; BE-32BIT-P9-PRIV-NEXT: ori r4, r4, 65508
+; BE-32BIT-P9-PRIV-NEXT: addi r5, r31, 32764
+; BE-32BIT-P9-PRIV-NEXT: stwx r3, r31, r4
+; BE-32BIT-P9-PRIV-NEXT: lwz r3, 12(r29)
; BE-32BIT-P9-PRIV-NEXT: lis r4, 0
; BE-32BIT-P9-PRIV-NEXT: ori r4, r4, 32768
-; BE-32BIT-P9-PRIV-NEXT: stwx r3, r1, r4
-; BE-32BIT-P9-PRIV-NEXT: lwz r3, 20(r31)
+; BE-32BIT-P9-PRIV-NEXT: stwx r3, r31, r4
+; BE-32BIT-P9-PRIV-NEXT: lwz r3, 20(r29)
; BE-32BIT-P9-PRIV-NEXT: lis r4, 0
-; BE-32BIT-P9-PRIV-NEXT: ori r4, r4, 65516
-; BE-32BIT-P9-PRIV-NEXT: stw r3, 32764(r1)
+; BE-32BIT-P9-PRIV-NEXT: ori r4, r4, 65508
+; BE-32BIT-P9-PRIV-NEXT: stw r3, 32764(r31)
; BE-32BIT-P9-PRIV-NEXT: lis r3, 0
-; BE-32BIT-P9-PRIV-NEXT: add r4, r1, r4
+; BE-32BIT-P9-PRIV-NEXT: add r4, r31, r4
; BE-32BIT-P9-PRIV-NEXT: ori r3, r3, 32768
-; BE-32BIT-P9-PRIV-NEXT: add r3, r1, r3
+; BE-32BIT-P9-PRIV-NEXT: add r3, r31, r3
; BE-32BIT-P9-PRIV-NEXT: bl .callee3[PR]
; BE-32BIT-P9-PRIV-NEXT: nop
-; BE-32BIT-P9-PRIV-NEXT: lwz r4, 16(r31)
-; BE-32BIT-P9-PRIV-NEXT: lwz r31, -4(r30) # 4-byte Folded Reload
+; BE-32BIT-P9-PRIV-NEXT: lwz r4, 16(r29)
+; BE-32BIT-P9-PRIV-NEXT: lwz r29, -12(r30) # 4-byte Folded Reload
; BE-32BIT-P9-PRIV-NEXT: add r3, r4, r3
; BE-32BIT-P9-PRIV-NEXT: mr r1, r30
; BE-32BIT-P9-PRIV-NEXT: lwz r0, 8(r1)
+; BE-32BIT-P9-PRIV-NEXT: lwz r31, -4(r1)
; BE-32BIT-P9-PRIV-NEXT: lwz r30, -8(r1)
; BE-32BIT-P9-PRIV-NEXT: mtlr r0
-; BE-32BIT-P9-PRIV-NEXT: hashchkp r0, -16(r1)
+; BE-32BIT-P9-PRIV-NEXT: hashchkp r0, -24(r1)
; BE-32BIT-P9-PRIV-NEXT: blr
;
; BE-32BIT-P8-PRIV-LABEL: aligned:
; BE-32BIT-P8-PRIV: # %bb.0: # %entry
; BE-32BIT-P8-PRIV-NEXT: mflr r0
+; BE-32BIT-P8-PRIV-NEXT: stw r31, -4(r1)
; BE-32BIT-P8-PRIV-NEXT: stw r30, -8(r1)
; BE-32BIT-P8-PRIV-NEXT: lis r12, -1
; BE-32BIT-P8-PRIV-NEXT: mr r30, r1
; BE-32BIT-P8-PRIV-NEXT: stw r0, 8(r1)
-; BE-32BIT-P8-PRIV-NEXT: hashstp r0, -16(r1)
+; BE-32BIT-P8-PRIV-NEXT: hashstp r0, -24(r1)
; BE-32BIT-P8-PRIV-NEXT: clrlwi r0, r1, 17
; BE-32BIT-P8-PRIV-NEXT: subc r0, r12, r0
; BE-32BIT-P8-PRIV-NEXT: stwux r1, r1, r0
; BE-32BIT-P8-PRIV-NEXT: lis r4, 0
-; BE-32BIT-P8-PRIV-NEXT: stw r31, -4(r30) # 4-byte Folded Spill
-; BE-32BIT-P8-PRIV-NEXT: mr r31, r3
+; BE-32BIT-P8-PRIV-NEXT: stw r29, -12(r30) # 4-byte Folded Spill
+; BE-32BIT-P8-PRIV-NEXT: mr r29, r3
; BE-32BIT-P8-PRIV-NEXT: lwz r3, 4(r3)
-; BE-32BIT-P8-PRIV-NEXT: addi r5, r1, 32764
-; BE-32BIT-P8-PRIV-NEXT: ori r4, r4, 65516
-; BE-32BIT-P8-PRIV-NEXT: stwx r3, r1, r4
+; BE-32BIT-P8-PRIV-NEXT: mr r31, r1
+; BE-32BIT-P8-PRIV-NEXT: ori r4, r4, 65508
+; BE-32BIT-P8-PRIV-NEXT: addi r5, r31, 32764
+; BE-32BIT-P8-PRIV-NEXT: stwx r3, r31, r4
; BE-32BIT-P8-PRIV-NEXT: lis r4, 0
-; BE-32BIT-P8-PRIV-NEXT: lwz r3, 12(r31)
+; BE-32BIT-P8-PRIV-NEXT: lwz r3, 12(r29)
; BE-32BIT-P8-PRIV-NEXT: ori r4, r4, 32768
-; BE-32BIT-P8-PRIV-NEXT: stwx r3, r1, r4
-; BE-32BIT-P8-PRIV-NEXT: lwz r3, 20(r31)
+; BE-32BIT-P8-PRIV-NEXT: stwx r3, r31, r4
+; BE-32BIT-P8-PRIV-NEXT: lwz r3, 20(r29)
; BE-32BIT-P8-PRIV-NEXT: lis r4, 0
-; BE-32BIT-P8-PRIV-NEXT: ori r4, r4, 65516
-; BE-32BIT-P8-PRIV-NEXT: stw r3, 32764(r1)
+; BE-32BIT-P8-PRIV-NEXT: ori r4, r4, 65508
+; BE-32BIT-P8-PRIV-NEXT: stw r3, 32764(r31)
; BE-32BIT-P8-PRIV-NEXT: lis r3, 0
-; BE-32BIT-P8-PRIV-NEXT: add r4, r1, r4
+; BE-32BIT-P8-PRIV-NEXT: add r4, r31, r4
; BE-32BIT-P8-PRIV-NEXT: ori r3, r3, 32768
-; BE-32BIT-P8-PRIV-NEXT: add r3, r1, r3
+; BE-32BIT-P8-PRIV-NEXT: add r3, r31, r3
; BE-32BIT-P8-PRIV-NEXT: bl .callee3[PR]
; BE-32BIT-P8-PRIV-NEXT: nop
-; BE-32BIT-P8-PRIV-NEXT: lwz r4, 16(r31)
-; BE-32BIT-P8-PRIV-NEXT: lwz r31, -4(r30) # 4-byte Folded Reload
+; BE-32BIT-P8-PRIV-NEXT: lwz r4, 16(r29)
+; BE-32BIT-P8-PRIV-NEXT: lwz r29, -12(r30) # 4-byte Folded Reload
; BE-32BIT-P8-PRIV-NEXT: add r3, r4, r3
; BE-32BIT-P8-PRIV-NEXT: mr r1, r30
; BE-32BIT-P8-PRIV-NEXT: lwz r0, 8(r1)
+; BE-32BIT-P8-PRIV-NEXT: lwz r31, -4(r1)
; BE-32BIT-P8-PRIV-NEXT: lwz r30, -8(r1)
-; BE-32BIT-P8-PRIV-NEXT: hashchkp r0, -16(r1)
+; BE-32BIT-P8-PRIV-NEXT: hashchkp r0, -24(r1)
; BE-32BIT-P8-PRIV-NEXT: mtlr r0
; BE-32BIT-P8-PRIV-NEXT: blr
entry:
>From 069da92030f3137fe108af3c4eaf7c6ab584e980 Mon Sep 17 00:00:00 2001
From: Zaara Syeda <syzaara at cpap8104.rtp.raleigh.ibm.com>
Date: Mon, 29 Jul 2024 16:30:37 -0400
Subject: [PATCH 2/2] Address review comments
---
llvm/lib/Target/PowerPC/PPCFrameLowering.cpp | 27 ++-
llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp | 2 +-
llvm/test/CodeGen/PowerPC/aix-base-pointer.ll | 6 +-
.../PowerPC/ppc64-rop-protection-aix.ll | 156 ++++++++----------
4 files changed, 88 insertions(+), 103 deletions(-)
diff --git a/llvm/lib/Target/PowerPC/PPCFrameLowering.cpp b/llvm/lib/Target/PowerPC/PPCFrameLowering.cpp
index 11332dbd8147c..9dfeefc40324e 100644
--- a/llvm/lib/Target/PowerPC/PPCFrameLowering.cpp
+++ b/llvm/lib/Target/PowerPC/PPCFrameLowering.cpp
@@ -376,8 +376,6 @@ bool PPCFrameLowering::needsFP(const MachineFunction &MF) const {
if (MF.getFunction().hasFnAttribute(Attribute::Naked))
return false;
- if (Subtarget.isAIXABI() && Subtarget.getRegisterInfo()->hasBasePointer(MF))
- return true;
return MF.getTarget().Options.DisableFramePointerElim(MF) ||
MFI.hasVarSizedObjects() || MFI.hasStackMap() || MFI.hasPatchPoint() ||
@@ -699,7 +697,7 @@ void PPCFrameLowering::emitPrologue(MachineFunction &MF,
int64_t LROffset = getReturnSaveOffset();
int64_t FPOffset = 0;
- if (HasFP) {
+ if (HasFP || (HasBP && Subtarget.isAIXABI())) {
MachineFrameInfo &MFI = MF.getFrameInfo();
int FPIndex = FI->getFramePointerSaveIndex();
assert(FPIndex && "No Frame Pointer Save Slot!");
@@ -824,7 +822,7 @@ void PPCFrameLowering::emitPrologue(MachineFunction &MF,
BuildMoveFromCR();
if (HasRedZone) {
- if (HasFP)
+ if (HasFP || (HasBP && Subtarget.isAIXABI()))
BuildMI(MBB, MBBI, dl, StoreInst)
.addReg(FPReg)
.addImm(FPOffset)
@@ -1010,7 +1008,7 @@ void PPCFrameLowering::emitPrologue(MachineFunction &MF,
// R0 cannot be used as a base register, but it can be used as an
// index in a store-indexed.
int LastOffset = 0;
- if (HasFP) {
+ if (HasFP || (HasBP && Subtarget.isAIXABI())) {
// R0 += (FPOffset-LastOffset).
// Need addic, since addi treats R0 as 0.
BuildMI(MBB, MBBI, dl, TII.get(PPC::ADDIC), ScratchReg)
@@ -1055,7 +1053,7 @@ void PPCFrameLowering::emitPrologue(MachineFunction &MF,
// Now that the stack frame has been allocated, save all the necessary
// registers using ScratchReg as the base address.
- if (HasFP)
+ if (HasFP || (HasBP && Subtarget.isAIXABI()))
BuildMI(MBB, MBBI, dl, StoreInst)
.addReg(FPReg)
.addImm(FPOffset)
@@ -1080,7 +1078,7 @@ void PPCFrameLowering::emitPrologue(MachineFunction &MF,
// field of STWU). To be here we have to be compiling for PPC32.
// Since the SPReg has been decreased by FrameSize, add it back to each
// offset.
- if (HasFP)
+ if (HasFP || (HasBP && Subtarget.isAIXABI()))
BuildMI(MBB, MBBI, dl, StoreInst)
.addReg(FPReg)
.addImm(FrameSize + FPOffset)
@@ -1126,7 +1124,7 @@ void PPCFrameLowering::emitPrologue(MachineFunction &MF,
BuildMI(MBB, MBBI, dl, TII.get(TargetOpcode::CFI_INSTRUCTION))
.addCFIIndex(CFIIndex);
- if (HasFP) {
+ if (HasFP || (HasBP && Subtarget.isAIXABI())) {
// Describe where FP was saved, at a fixed offset from CFA.
unsigned Reg = MRI->getDwarfRegNum(FPReg, true);
CFIIndex = MF.addFrameInst(
@@ -1609,7 +1607,7 @@ void PPCFrameLowering::emitEpilogue(MachineFunction &MF,
SingleScratchReg = ScratchReg == TempReg;
- if (HasFP) {
+ if (HasFP || (HasBP && Subtarget.isAIXABI())) {
int FPIndex = FI->getFramePointerSaveIndex();
assert(FPIndex && "No Frame Pointer Save Slot!");
FPOffset = MFI.getObjectOffset(FPIndex);
@@ -1805,7 +1803,7 @@ void PPCFrameLowering::emitEpilogue(MachineFunction &MF,
.addReg(RBReg);
}
- if (HasFP) {
+ if (HasFP || (HasBP && Subtarget.isAIXABI())) {
// If there is red zone, restore FP directly, since SP has already been
// restored. Otherwise, restore the value of FP into ScratchReg.
if (HasRedZone || RBReg == SPReg)
@@ -1997,7 +1995,8 @@ void PPCFrameLowering::determineCalleeSaves(MachineFunction &MF,
MachineFrameInfo &MFI = MF.getFrameInfo();
// If the frame pointer save index hasn't been defined yet.
- if (!FPSI && needsFP(MF)) {
+ if (!FPSI && (needsFP(MF)
+ || (RegInfo->hasBasePointer(MF) && Subtarget.isAIXABI()))) {
// Find out what the fix offset of the frame pointer save area.
int FPOffset = getFramePointerSaveOffset();
// Allocate the frame index for frame pointer save area.
@@ -2026,7 +2025,7 @@ void PPCFrameLowering::determineCalleeSaves(MachineFunction &MF,
// some inline asm which explicitly clobbers it, when we otherwise have a
// frame pointer and are using r31's spill slot for the prologue/epilogue
// code. Same goes for the base pointer and the PIC base register.
- if (needsFP(MF))
+ if (needsFP(MF) || (RegInfo->hasBasePointer(MF) && Subtarget.isAIXABI()))
SavedRegs.reset(isPPC64 ? PPC::X31 : PPC::R31);
if (RegInfo->hasBasePointer(MF))
SavedRegs.reset(RegInfo->getBaseRegister(MF));
@@ -2169,9 +2168,10 @@ void PPCFrameLowering::processFunctionBeforeFrameFinalized(MachineFunction &MF,
LowerBound -= (31 - TRI->getEncodingValue(MinFPR) + 1) * 8;
}
+ const PPCRegisterInfo *RegInfo = Subtarget.getRegisterInfo();
// Check whether the frame pointer register is allocated. If so, make sure it
// is spilled to the correct offset.
- if (needsFP(MF)) {
+ if (needsFP(MF) || (RegInfo->hasBasePointer(MF) && Subtarget.isAIXABI())) {
int FI = PFI->getFramePointerSaveIndex();
assert(FI && "No Frame Pointer Save Slot!");
MFI.setObjectOffset(FI, LowerBound + MFI.getObjectOffset(FI));
@@ -2188,7 +2188,6 @@ void PPCFrameLowering::processFunctionBeforeFrameFinalized(MachineFunction &MF,
HasGPSaveArea = true;
}
- const PPCRegisterInfo *RegInfo = Subtarget.getRegisterInfo();
if (RegInfo->hasBasePointer(MF)) {
int FI = PFI->getBasePointerSaveIndex();
assert(FI && "No Base Pointer Save Slot!");
diff --git a/llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp b/llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp
index 9e8da59615dfb..96a5683320a8d 100644
--- a/llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp
+++ b/llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp
@@ -402,7 +402,7 @@ BitVector PPCRegisterInfo::getReservedRegs(const MachineFunction &MF) const {
if (TM.isPPC64())
markSuperRegs(Reserved, PPC::R13);
- if (TFI->needsFP(MF))
+ if (TFI->needsFP(MF) || (hasBasePointer(MF) && Subtarget.isAIXABI()))
markSuperRegs(Reserved, PPC::R31);
bool IsPositionIndependent = TM.isPositionIndependent();
diff --git a/llvm/test/CodeGen/PowerPC/aix-base-pointer.ll b/llvm/test/CodeGen/PowerPC/aix-base-pointer.ll
index cc4f0ee92c5dc..18894e6c97c43 100644
--- a/llvm/test/CodeGen/PowerPC/aix-base-pointer.ll
+++ b/llvm/test/CodeGen/PowerPC/aix-base-pointer.ll
@@ -26,8 +26,7 @@ declare void @callee(ptr)
; 32BIT: clrlwi 0, 1, 27
; 32BIT: subfic 0, 0, -224
; 32BIT: stwux 1, 1, 0
-; 32BIT: mr 31, 1
-; 32BIT: addi 3, 31, 64
+; 32BIT: addi 3, 1, 64
; 32BIT: bl .callee
; 32BIT: mr 1, 30
; 32BIT: lwz 31, -12(1)
@@ -40,8 +39,7 @@ declare void @callee(ptr)
; 64BIT: clrldi 0, 1, 59
; 64BIT: subfic 0, 0, -288
; 64BIT: stdux 1, 1, 0
-; 64BIT: mr 31, 1
-; 64BIT: addi 3, 31, 128
+; 64BIT: addi 3, 1, 128
; 64BIT: bl .callee
; 64BIT: mr 1, 30
; 64BIT: ld 31, -16(1)
diff --git a/llvm/test/CodeGen/PowerPC/ppc64-rop-protection-aix.ll b/llvm/test/CodeGen/PowerPC/ppc64-rop-protection-aix.ll
index 318b6d2fc6aa3..bb12e529bbbdb 100644
--- a/llvm/test/CodeGen/PowerPC/ppc64-rop-protection-aix.ll
+++ b/llvm/test/CodeGen/PowerPC/ppc64-rop-protection-aix.ll
@@ -2310,22 +2310,21 @@ define dso_local zeroext i32 @aligned(ptr nocapture readonly %in) #0 {
; BE-P10-NEXT: mr r29, r3
; BE-P10-NEXT: lwz r3, 4(r3)
; BE-P10-NEXT: lis r4, 0
-; BE-P10-NEXT: mr r31, r1
+; BE-P10-NEXT: addi r5, r1, 32764
; BE-P10-NEXT: ori r4, r4, 65500
-; BE-P10-NEXT: stwx r3, r31, r4
+; BE-P10-NEXT: stwx r3, r1, r4
; BE-P10-NEXT: lwz r3, 12(r29)
; BE-P10-NEXT: lis r4, 0
; BE-P10-NEXT: ori r4, r4, 32768
-; BE-P10-NEXT: stwx r3, r31, r4
+; BE-P10-NEXT: stwx r3, r1, r4
; BE-P10-NEXT: lwz r3, 20(r29)
; BE-P10-NEXT: lis r4, 0
; BE-P10-NEXT: ori r4, r4, 65500
-; BE-P10-NEXT: stw r3, 32764(r31)
+; BE-P10-NEXT: add r4, r1, r4
+; BE-P10-NEXT: stw r3, 32764(r1)
; BE-P10-NEXT: lis r3, 0
; BE-P10-NEXT: ori r3, r3, 32768
-; BE-P10-NEXT: add r3, r31, r3
-; BE-P10-NEXT: add r4, r31, r4
-; BE-P10-NEXT: addi r5, r31, 32764
+; BE-P10-NEXT: add r3, r1, r3
; BE-P10-NEXT: bl .callee3[PR]
; BE-P10-NEXT: nop
; BE-P10-NEXT: lwz r4, 16(r29)
@@ -2356,22 +2355,21 @@ define dso_local zeroext i32 @aligned(ptr nocapture readonly %in) #0 {
; BE-P9-NEXT: mr r29, r3
; BE-P9-NEXT: lwz r3, 4(r3)
; BE-P9-NEXT: lis r4, 0
-; BE-P9-NEXT: mr r31, r1
+; BE-P9-NEXT: addi r5, r1, 32764
; BE-P9-NEXT: ori r4, r4, 65500
-; BE-P9-NEXT: addi r5, r31, 32764
-; BE-P9-NEXT: stwx r3, r31, r4
+; BE-P9-NEXT: stwx r3, r1, r4
; BE-P9-NEXT: lwz r3, 12(r29)
; BE-P9-NEXT: lis r4, 0
; BE-P9-NEXT: ori r4, r4, 32768
-; BE-P9-NEXT: stwx r3, r31, r4
+; BE-P9-NEXT: stwx r3, r1, r4
; BE-P9-NEXT: lwz r3, 20(r29)
; BE-P9-NEXT: lis r4, 0
; BE-P9-NEXT: ori r4, r4, 65500
-; BE-P9-NEXT: stw r3, 32764(r31)
+; BE-P9-NEXT: stw r3, 32764(r1)
; BE-P9-NEXT: lis r3, 0
-; BE-P9-NEXT: add r4, r31, r4
+; BE-P9-NEXT: add r4, r1, r4
; BE-P9-NEXT: ori r3, r3, 32768
-; BE-P9-NEXT: add r3, r31, r3
+; BE-P9-NEXT: add r3, r1, r3
; BE-P9-NEXT: bl .callee3[PR]
; BE-P9-NEXT: nop
; BE-P9-NEXT: lwz r4, 16(r29)
@@ -2402,22 +2400,21 @@ define dso_local zeroext i32 @aligned(ptr nocapture readonly %in) #0 {
; BE-P8-NEXT: std r29, -24(r30) # 8-byte Folded Spill
; BE-P8-NEXT: mr r29, r3
; BE-P8-NEXT: lwz r3, 4(r3)
-; BE-P8-NEXT: mr r31, r1
+; BE-P8-NEXT: addi r5, r1, 32764
; BE-P8-NEXT: ori r4, r4, 65500
-; BE-P8-NEXT: addi r5, r31, 32764
-; BE-P8-NEXT: stwx r3, r31, r4
+; BE-P8-NEXT: stwx r3, r1, r4
; BE-P8-NEXT: lis r4, 0
; BE-P8-NEXT: lwz r3, 12(r29)
; BE-P8-NEXT: ori r4, r4, 32768
-; BE-P8-NEXT: stwx r3, r31, r4
+; BE-P8-NEXT: stwx r3, r1, r4
; BE-P8-NEXT: lwz r3, 20(r29)
; BE-P8-NEXT: lis r4, 0
; BE-P8-NEXT: ori r4, r4, 65500
-; BE-P8-NEXT: stw r3, 32764(r31)
+; BE-P8-NEXT: stw r3, 32764(r1)
; BE-P8-NEXT: lis r3, 0
-; BE-P8-NEXT: add r4, r31, r4
+; BE-P8-NEXT: add r4, r1, r4
; BE-P8-NEXT: ori r3, r3, 32768
-; BE-P8-NEXT: add r3, r31, r3
+; BE-P8-NEXT: add r3, r1, r3
; BE-P8-NEXT: bl .callee3[PR]
; BE-P8-NEXT: nop
; BE-P8-NEXT: lwz r4, 16(r29)
@@ -2448,22 +2445,21 @@ define dso_local zeroext i32 @aligned(ptr nocapture readonly %in) #0 {
; BE-32BIT-P10-NEXT: mr r29, r3
; BE-32BIT-P10-NEXT: lwz r3, 4(r3)
; BE-32BIT-P10-NEXT: lis r4, 0
-; BE-32BIT-P10-NEXT: mr r31, r1
+; BE-32BIT-P10-NEXT: addi r5, r1, 32764
; BE-32BIT-P10-NEXT: ori r4, r4, 65508
-; BE-32BIT-P10-NEXT: stwx r3, r31, r4
+; BE-32BIT-P10-NEXT: stwx r3, r1, r4
; BE-32BIT-P10-NEXT: lwz r3, 12(r29)
; BE-32BIT-P10-NEXT: lis r4, 0
; BE-32BIT-P10-NEXT: ori r4, r4, 32768
-; BE-32BIT-P10-NEXT: stwx r3, r31, r4
+; BE-32BIT-P10-NEXT: stwx r3, r1, r4
; BE-32BIT-P10-NEXT: lwz r3, 20(r29)
; BE-32BIT-P10-NEXT: lis r4, 0
; BE-32BIT-P10-NEXT: ori r4, r4, 65508
-; BE-32BIT-P10-NEXT: stw r3, 32764(r31)
+; BE-32BIT-P10-NEXT: add r4, r1, r4
+; BE-32BIT-P10-NEXT: stw r3, 32764(r1)
; BE-32BIT-P10-NEXT: lis r3, 0
; BE-32BIT-P10-NEXT: ori r3, r3, 32768
-; BE-32BIT-P10-NEXT: add r3, r31, r3
-; BE-32BIT-P10-NEXT: add r4, r31, r4
-; BE-32BIT-P10-NEXT: addi r5, r31, 32764
+; BE-32BIT-P10-NEXT: add r3, r1, r3
; BE-32BIT-P10-NEXT: bl .callee3[PR]
; BE-32BIT-P10-NEXT: nop
; BE-32BIT-P10-NEXT: lwz r4, 16(r29)
@@ -2493,22 +2489,21 @@ define dso_local zeroext i32 @aligned(ptr nocapture readonly %in) #0 {
; BE-32BIT-P9-NEXT: mr r29, r3
; BE-32BIT-P9-NEXT: lwz r3, 4(r3)
; BE-32BIT-P9-NEXT: lis r4, 0
-; BE-32BIT-P9-NEXT: mr r31, r1
+; BE-32BIT-P9-NEXT: addi r5, r1, 32764
; BE-32BIT-P9-NEXT: ori r4, r4, 65508
-; BE-32BIT-P9-NEXT: addi r5, r31, 32764
-; BE-32BIT-P9-NEXT: stwx r3, r31, r4
+; BE-32BIT-P9-NEXT: stwx r3, r1, r4
; BE-32BIT-P9-NEXT: lwz r3, 12(r29)
; BE-32BIT-P9-NEXT: lis r4, 0
; BE-32BIT-P9-NEXT: ori r4, r4, 32768
-; BE-32BIT-P9-NEXT: stwx r3, r31, r4
+; BE-32BIT-P9-NEXT: stwx r3, r1, r4
; BE-32BIT-P9-NEXT: lwz r3, 20(r29)
; BE-32BIT-P9-NEXT: lis r4, 0
; BE-32BIT-P9-NEXT: ori r4, r4, 65508
-; BE-32BIT-P9-NEXT: stw r3, 32764(r31)
+; BE-32BIT-P9-NEXT: stw r3, 32764(r1)
; BE-32BIT-P9-NEXT: lis r3, 0
-; BE-32BIT-P9-NEXT: add r4, r31, r4
+; BE-32BIT-P9-NEXT: add r4, r1, r4
; BE-32BIT-P9-NEXT: ori r3, r3, 32768
-; BE-32BIT-P9-NEXT: add r3, r31, r3
+; BE-32BIT-P9-NEXT: add r3, r1, r3
; BE-32BIT-P9-NEXT: bl .callee3[PR]
; BE-32BIT-P9-NEXT: nop
; BE-32BIT-P9-NEXT: lwz r4, 16(r29)
@@ -2538,22 +2533,21 @@ define dso_local zeroext i32 @aligned(ptr nocapture readonly %in) #0 {
; BE-32BIT-P8-NEXT: stw r29, -12(r30) # 4-byte Folded Spill
; BE-32BIT-P8-NEXT: mr r29, r3
; BE-32BIT-P8-NEXT: lwz r3, 4(r3)
-; BE-32BIT-P8-NEXT: mr r31, r1
+; BE-32BIT-P8-NEXT: addi r5, r1, 32764
; BE-32BIT-P8-NEXT: ori r4, r4, 65508
-; BE-32BIT-P8-NEXT: addi r5, r31, 32764
-; BE-32BIT-P8-NEXT: stwx r3, r31, r4
+; BE-32BIT-P8-NEXT: stwx r3, r1, r4
; BE-32BIT-P8-NEXT: lis r4, 0
; BE-32BIT-P8-NEXT: lwz r3, 12(r29)
; BE-32BIT-P8-NEXT: ori r4, r4, 32768
-; BE-32BIT-P8-NEXT: stwx r3, r31, r4
+; BE-32BIT-P8-NEXT: stwx r3, r1, r4
; BE-32BIT-P8-NEXT: lwz r3, 20(r29)
; BE-32BIT-P8-NEXT: lis r4, 0
; BE-32BIT-P8-NEXT: ori r4, r4, 65508
-; BE-32BIT-P8-NEXT: stw r3, 32764(r31)
+; BE-32BIT-P8-NEXT: stw r3, 32764(r1)
; BE-32BIT-P8-NEXT: lis r3, 0
-; BE-32BIT-P8-NEXT: add r4, r31, r4
+; BE-32BIT-P8-NEXT: add r4, r1, r4
; BE-32BIT-P8-NEXT: ori r3, r3, 32768
-; BE-32BIT-P8-NEXT: add r3, r31, r3
+; BE-32BIT-P8-NEXT: add r3, r1, r3
; BE-32BIT-P8-NEXT: bl .callee3[PR]
; BE-32BIT-P8-NEXT: nop
; BE-32BIT-P8-NEXT: lwz r4, 16(r29)
@@ -2583,22 +2577,21 @@ define dso_local zeroext i32 @aligned(ptr nocapture readonly %in) #0 {
; BE-P10-PRIV-NEXT: mr r29, r3
; BE-P10-PRIV-NEXT: lwz r3, 4(r3)
; BE-P10-PRIV-NEXT: lis r4, 0
-; BE-P10-PRIV-NEXT: mr r31, r1
+; BE-P10-PRIV-NEXT: addi r5, r1, 32764
; BE-P10-PRIV-NEXT: ori r4, r4, 65500
-; BE-P10-PRIV-NEXT: stwx r3, r31, r4
+; BE-P10-PRIV-NEXT: stwx r3, r1, r4
; BE-P10-PRIV-NEXT: lwz r3, 12(r29)
; BE-P10-PRIV-NEXT: lis r4, 0
; BE-P10-PRIV-NEXT: ori r4, r4, 32768
-; BE-P10-PRIV-NEXT: stwx r3, r31, r4
+; BE-P10-PRIV-NEXT: stwx r3, r1, r4
; BE-P10-PRIV-NEXT: lwz r3, 20(r29)
; BE-P10-PRIV-NEXT: lis r4, 0
; BE-P10-PRIV-NEXT: ori r4, r4, 65500
-; BE-P10-PRIV-NEXT: stw r3, 32764(r31)
+; BE-P10-PRIV-NEXT: add r4, r1, r4
+; BE-P10-PRIV-NEXT: stw r3, 32764(r1)
; BE-P10-PRIV-NEXT: lis r3, 0
; BE-P10-PRIV-NEXT: ori r3, r3, 32768
-; BE-P10-PRIV-NEXT: add r3, r31, r3
-; BE-P10-PRIV-NEXT: add r4, r31, r4
-; BE-P10-PRIV-NEXT: addi r5, r31, 32764
+; BE-P10-PRIV-NEXT: add r3, r1, r3
; BE-P10-PRIV-NEXT: bl .callee3[PR]
; BE-P10-PRIV-NEXT: nop
; BE-P10-PRIV-NEXT: lwz r4, 16(r29)
@@ -2629,22 +2622,21 @@ define dso_local zeroext i32 @aligned(ptr nocapture readonly %in) #0 {
; BE-P9-PRIV-NEXT: mr r29, r3
; BE-P9-PRIV-NEXT: lwz r3, 4(r3)
; BE-P9-PRIV-NEXT: lis r4, 0
-; BE-P9-PRIV-NEXT: mr r31, r1
+; BE-P9-PRIV-NEXT: addi r5, r1, 32764
; BE-P9-PRIV-NEXT: ori r4, r4, 65500
-; BE-P9-PRIV-NEXT: addi r5, r31, 32764
-; BE-P9-PRIV-NEXT: stwx r3, r31, r4
+; BE-P9-PRIV-NEXT: stwx r3, r1, r4
; BE-P9-PRIV-NEXT: lwz r3, 12(r29)
; BE-P9-PRIV-NEXT: lis r4, 0
; BE-P9-PRIV-NEXT: ori r4, r4, 32768
-; BE-P9-PRIV-NEXT: stwx r3, r31, r4
+; BE-P9-PRIV-NEXT: stwx r3, r1, r4
; BE-P9-PRIV-NEXT: lwz r3, 20(r29)
; BE-P9-PRIV-NEXT: lis r4, 0
; BE-P9-PRIV-NEXT: ori r4, r4, 65500
-; BE-P9-PRIV-NEXT: stw r3, 32764(r31)
+; BE-P9-PRIV-NEXT: stw r3, 32764(r1)
; BE-P9-PRIV-NEXT: lis r3, 0
-; BE-P9-PRIV-NEXT: add r4, r31, r4
+; BE-P9-PRIV-NEXT: add r4, r1, r4
; BE-P9-PRIV-NEXT: ori r3, r3, 32768
-; BE-P9-PRIV-NEXT: add r3, r31, r3
+; BE-P9-PRIV-NEXT: add r3, r1, r3
; BE-P9-PRIV-NEXT: bl .callee3[PR]
; BE-P9-PRIV-NEXT: nop
; BE-P9-PRIV-NEXT: lwz r4, 16(r29)
@@ -2675,22 +2667,21 @@ define dso_local zeroext i32 @aligned(ptr nocapture readonly %in) #0 {
; BE-P8-PRIV-NEXT: std r29, -24(r30) # 8-byte Folded Spill
; BE-P8-PRIV-NEXT: mr r29, r3
; BE-P8-PRIV-NEXT: lwz r3, 4(r3)
-; BE-P8-PRIV-NEXT: mr r31, r1
+; BE-P8-PRIV-NEXT: addi r5, r1, 32764
; BE-P8-PRIV-NEXT: ori r4, r4, 65500
-; BE-P8-PRIV-NEXT: addi r5, r31, 32764
-; BE-P8-PRIV-NEXT: stwx r3, r31, r4
+; BE-P8-PRIV-NEXT: stwx r3, r1, r4
; BE-P8-PRIV-NEXT: lis r4, 0
; BE-P8-PRIV-NEXT: lwz r3, 12(r29)
; BE-P8-PRIV-NEXT: ori r4, r4, 32768
-; BE-P8-PRIV-NEXT: stwx r3, r31, r4
+; BE-P8-PRIV-NEXT: stwx r3, r1, r4
; BE-P8-PRIV-NEXT: lwz r3, 20(r29)
; BE-P8-PRIV-NEXT: lis r4, 0
; BE-P8-PRIV-NEXT: ori r4, r4, 65500
-; BE-P8-PRIV-NEXT: stw r3, 32764(r31)
+; BE-P8-PRIV-NEXT: stw r3, 32764(r1)
; BE-P8-PRIV-NEXT: lis r3, 0
-; BE-P8-PRIV-NEXT: add r4, r31, r4
+; BE-P8-PRIV-NEXT: add r4, r1, r4
; BE-P8-PRIV-NEXT: ori r3, r3, 32768
-; BE-P8-PRIV-NEXT: add r3, r31, r3
+; BE-P8-PRIV-NEXT: add r3, r1, r3
; BE-P8-PRIV-NEXT: bl .callee3[PR]
; BE-P8-PRIV-NEXT: nop
; BE-P8-PRIV-NEXT: lwz r4, 16(r29)
@@ -2721,22 +2712,21 @@ define dso_local zeroext i32 @aligned(ptr nocapture readonly %in) #0 {
; BE-32BIT-P10-PRIV-NEXT: mr r29, r3
; BE-32BIT-P10-PRIV-NEXT: lwz r3, 4(r3)
; BE-32BIT-P10-PRIV-NEXT: lis r4, 0
-; BE-32BIT-P10-PRIV-NEXT: mr r31, r1
+; BE-32BIT-P10-PRIV-NEXT: addi r5, r1, 32764
; BE-32BIT-P10-PRIV-NEXT: ori r4, r4, 65508
-; BE-32BIT-P10-PRIV-NEXT: stwx r3, r31, r4
+; BE-32BIT-P10-PRIV-NEXT: stwx r3, r1, r4
; BE-32BIT-P10-PRIV-NEXT: lwz r3, 12(r29)
; BE-32BIT-P10-PRIV-NEXT: lis r4, 0
; BE-32BIT-P10-PRIV-NEXT: ori r4, r4, 32768
-; BE-32BIT-P10-PRIV-NEXT: stwx r3, r31, r4
+; BE-32BIT-P10-PRIV-NEXT: stwx r3, r1, r4
; BE-32BIT-P10-PRIV-NEXT: lwz r3, 20(r29)
; BE-32BIT-P10-PRIV-NEXT: lis r4, 0
; BE-32BIT-P10-PRIV-NEXT: ori r4, r4, 65508
-; BE-32BIT-P10-PRIV-NEXT: stw r3, 32764(r31)
+; BE-32BIT-P10-PRIV-NEXT: add r4, r1, r4
+; BE-32BIT-P10-PRIV-NEXT: stw r3, 32764(r1)
; BE-32BIT-P10-PRIV-NEXT: lis r3, 0
; BE-32BIT-P10-PRIV-NEXT: ori r3, r3, 32768
-; BE-32BIT-P10-PRIV-NEXT: add r3, r31, r3
-; BE-32BIT-P10-PRIV-NEXT: add r4, r31, r4
-; BE-32BIT-P10-PRIV-NEXT: addi r5, r31, 32764
+; BE-32BIT-P10-PRIV-NEXT: add r3, r1, r3
; BE-32BIT-P10-PRIV-NEXT: bl .callee3[PR]
; BE-32BIT-P10-PRIV-NEXT: nop
; BE-32BIT-P10-PRIV-NEXT: lwz r4, 16(r29)
@@ -2766,22 +2756,21 @@ define dso_local zeroext i32 @aligned(ptr nocapture readonly %in) #0 {
; BE-32BIT-P9-PRIV-NEXT: mr r29, r3
; BE-32BIT-P9-PRIV-NEXT: lwz r3, 4(r3)
; BE-32BIT-P9-PRIV-NEXT: lis r4, 0
-; BE-32BIT-P9-PRIV-NEXT: mr r31, r1
+; BE-32BIT-P9-PRIV-NEXT: addi r5, r1, 32764
; BE-32BIT-P9-PRIV-NEXT: ori r4, r4, 65508
-; BE-32BIT-P9-PRIV-NEXT: addi r5, r31, 32764
-; BE-32BIT-P9-PRIV-NEXT: stwx r3, r31, r4
+; BE-32BIT-P9-PRIV-NEXT: stwx r3, r1, r4
; BE-32BIT-P9-PRIV-NEXT: lwz r3, 12(r29)
; BE-32BIT-P9-PRIV-NEXT: lis r4, 0
; BE-32BIT-P9-PRIV-NEXT: ori r4, r4, 32768
-; BE-32BIT-P9-PRIV-NEXT: stwx r3, r31, r4
+; BE-32BIT-P9-PRIV-NEXT: stwx r3, r1, r4
; BE-32BIT-P9-PRIV-NEXT: lwz r3, 20(r29)
; BE-32BIT-P9-PRIV-NEXT: lis r4, 0
; BE-32BIT-P9-PRIV-NEXT: ori r4, r4, 65508
-; BE-32BIT-P9-PRIV-NEXT: stw r3, 32764(r31)
+; BE-32BIT-P9-PRIV-NEXT: stw r3, 32764(r1)
; BE-32BIT-P9-PRIV-NEXT: lis r3, 0
-; BE-32BIT-P9-PRIV-NEXT: add r4, r31, r4
+; BE-32BIT-P9-PRIV-NEXT: add r4, r1, r4
; BE-32BIT-P9-PRIV-NEXT: ori r3, r3, 32768
-; BE-32BIT-P9-PRIV-NEXT: add r3, r31, r3
+; BE-32BIT-P9-PRIV-NEXT: add r3, r1, r3
; BE-32BIT-P9-PRIV-NEXT: bl .callee3[PR]
; BE-32BIT-P9-PRIV-NEXT: nop
; BE-32BIT-P9-PRIV-NEXT: lwz r4, 16(r29)
@@ -2811,22 +2800,21 @@ define dso_local zeroext i32 @aligned(ptr nocapture readonly %in) #0 {
; BE-32BIT-P8-PRIV-NEXT: stw r29, -12(r30) # 4-byte Folded Spill
; BE-32BIT-P8-PRIV-NEXT: mr r29, r3
; BE-32BIT-P8-PRIV-NEXT: lwz r3, 4(r3)
-; BE-32BIT-P8-PRIV-NEXT: mr r31, r1
+; BE-32BIT-P8-PRIV-NEXT: addi r5, r1, 32764
; BE-32BIT-P8-PRIV-NEXT: ori r4, r4, 65508
-; BE-32BIT-P8-PRIV-NEXT: addi r5, r31, 32764
-; BE-32BIT-P8-PRIV-NEXT: stwx r3, r31, r4
+; BE-32BIT-P8-PRIV-NEXT: stwx r3, r1, r4
; BE-32BIT-P8-PRIV-NEXT: lis r4, 0
; BE-32BIT-P8-PRIV-NEXT: lwz r3, 12(r29)
; BE-32BIT-P8-PRIV-NEXT: ori r4, r4, 32768
-; BE-32BIT-P8-PRIV-NEXT: stwx r3, r31, r4
+; BE-32BIT-P8-PRIV-NEXT: stwx r3, r1, r4
; BE-32BIT-P8-PRIV-NEXT: lwz r3, 20(r29)
; BE-32BIT-P8-PRIV-NEXT: lis r4, 0
; BE-32BIT-P8-PRIV-NEXT: ori r4, r4, 65508
-; BE-32BIT-P8-PRIV-NEXT: stw r3, 32764(r31)
+; BE-32BIT-P8-PRIV-NEXT: stw r3, 32764(r1)
; BE-32BIT-P8-PRIV-NEXT: lis r3, 0
-; BE-32BIT-P8-PRIV-NEXT: add r4, r31, r4
+; BE-32BIT-P8-PRIV-NEXT: add r4, r1, r4
; BE-32BIT-P8-PRIV-NEXT: ori r3, r3, 32768
-; BE-32BIT-P8-PRIV-NEXT: add r3, r31, r3
+; BE-32BIT-P8-PRIV-NEXT: add r3, r1, r3
; BE-32BIT-P8-PRIV-NEXT: bl .callee3[PR]
; BE-32BIT-P8-PRIV-NEXT: nop
; BE-32BIT-P8-PRIV-NEXT: lwz r4, 16(r29)
More information about the llvm-commits
mailing list