From 3bd78b7cc00d842782226bb9884ebf8d9d1f07bd Mon Sep 17 00:00:00 2001 From: "Kazushi (Jam) Marukawa" Date: Thu, 26 Nov 2020 22:27:34 +0900 Subject: [PATCH] [VE] Optimize emitSPAdjustment function Optimize emitSPAdjustment function to generate as small as possible instructions to adjust SP. Reviewed By: simoll Differential Revision: https://reviews.llvm.org/D92174 --- llvm/lib/Target/VE/VEFrameLowering.cpp | 49 +++++++++------- .../VE/Scalar/function_prologue_epilogue.ll | 12 +--- .../CodeGen/VE/Scalar/stackframe_align.ll | 56 +++++-------------- .../test/CodeGen/VE/Scalar/stackframe_call.ll | 48 ++++------------ .../CodeGen/VE/Scalar/stackframe_nocall.ll | 36 +++--------- .../test/CodeGen/VE/Scalar/stackframe_size.ll | 24 ++------ 6 files changed, 72 insertions(+), 153 deletions(-) diff --git a/llvm/lib/Target/VE/VEFrameLowering.cpp b/llvm/lib/Target/VE/VEFrameLowering.cpp index e15e4130f74b..951430be8f61 100644 --- a/llvm/lib/Target/VE/VEFrameLowering.cpp +++ b/llvm/lib/Target/VE/VEFrameLowering.cpp @@ -225,33 +225,40 @@ void VEFrameLowering::emitSPAdjustment(MachineFunction &MF, int64_t NumBytes, MaybeAlign MaybeAlign) const { DebugLoc DL; - const VEInstrInfo &TII = - *static_cast(MF.getSubtarget().getInstrInfo()); + const VEInstrInfo &TII = *STI.getInstrInfo(); - if (NumBytes >= -64 && NumBytes < 63) { + if (NumBytes == 0) { + // Nothing to do here. + } else if (isInt<7>(NumBytes)) { + // adds.l %s11, NumBytes@lo, %s11 BuildMI(MBB, MBBI, DL, TII.get(VE::ADDSLri), VE::SX11) .addReg(VE::SX11) .addImm(NumBytes); - return; + } else if (isInt<32>(NumBytes)) { + // lea %s11, NumBytes@lo(, %s11) + BuildMI(MBB, MBBI, DL, TII.get(VE::LEArii), VE::SX11) + .addReg(VE::SX11) + .addImm(0) + .addImm(Lo_32(NumBytes)); + } else { + // Emit following codes. This clobbers SX13 which we always know is + // available here. + // lea %s13, NumBytes@lo + // and %s13, %s13, (32)0 + // lea.sl %sp, NumBytes@hi(%s13, %sp) + BuildMI(MBB, MBBI, DL, TII.get(VE::LEAzii), VE::SX13) + .addImm(0) + .addImm(0) + .addImm(Lo_32(NumBytes)); + BuildMI(MBB, MBBI, DL, TII.get(VE::ANDrm), VE::SX13) + .addReg(VE::SX13) + .addImm(M0(32)); + BuildMI(MBB, MBBI, DL, TII.get(VE::LEASLrri), VE::SX11) + .addReg(VE::SX11) + .addReg(VE::SX13) + .addImm(Hi_32(NumBytes)); } - // Emit following codes. This clobbers SX13 which we always know is - // available here. - // lea %s13,%lo(NumBytes) - // and %s13,%s13,(32)0 - // lea.sl %sp,%hi(NumBytes)(%sp, %s13) - BuildMI(MBB, MBBI, DL, TII.get(VE::LEAzii), VE::SX13) - .addImm(0) - .addImm(0) - .addImm(Lo_32(NumBytes)); - BuildMI(MBB, MBBI, DL, TII.get(VE::ANDrm), VE::SX13) - .addReg(VE::SX13) - .addImm(M0(32)); - BuildMI(MBB, MBBI, DL, TII.get(VE::LEASLrri), VE::SX11) - .addReg(VE::SX11) - .addReg(VE::SX13) - .addImm(Hi_32(NumBytes)); - if (MaybeAlign) { // and %sp, %sp, Align-1 BuildMI(MBB, MBBI, DL, TII.get(VE::ANDrm), VE::SX11) diff --git a/llvm/test/CodeGen/VE/Scalar/function_prologue_epilogue.ll b/llvm/test/CodeGen/VE/Scalar/function_prologue_epilogue.ll index 1d6314a02070..bc3f9d633e95 100644 --- a/llvm/test/CodeGen/VE/Scalar/function_prologue_epilogue.ll +++ b/llvm/test/CodeGen/VE/Scalar/function_prologue_epilogue.ll @@ -33,9 +33,7 @@ define i8 @func_gv() { ; PIC-NEXT: st %s15, 24(, %s11) ; PIC-NEXT: st %s16, 32(, %s11) ; PIC-NEXT: or %s9, 0, %s11 -; PIC-NEXT: lea %s13, -176 -; PIC-NEXT: and %s13, %s13, (32)0 -; PIC-NEXT: lea.sl %s11, -1(%s13, %s11) +; PIC-NEXT: lea %s11, -176(, %s11) ; PIC-NEXT: brge.l.t %s11, %s8, .LBB1_2 ; PIC-NEXT: # %bb.1: ; PIC-NEXT: ld %s61, 24(, %s14) @@ -75,9 +73,7 @@ define i32 @func_alloca(i32 signext %0) { ; CHECK-NEXT: st %s15, 24(, %s11) ; CHECK-NEXT: st %s16, 32(, %s11) ; CHECK-NEXT: or %s9, 0, %s11 -; CHECK-NEXT: lea %s13, -192 -; CHECK-NEXT: and %s13, %s13, (32)0 -; CHECK-NEXT: lea.sl %s11, -1(%s13, %s11) +; CHECK-NEXT: lea %s11, -192(, %s11) ; CHECK-NEXT: brge.l.t %s11, %s8, .LBB2_2 ; CHECK-NEXT: # %bb.1: ; CHECK-NEXT: ld %s61, 24(, %s14) @@ -104,9 +100,7 @@ define i32 @func_alloca(i32 signext %0) { ; PIC-NEXT: st %s15, 24(, %s11) ; PIC-NEXT: st %s16, 32(, %s11) ; PIC-NEXT: or %s9, 0, %s11 -; PIC-NEXT: lea %s13, -192 -; PIC-NEXT: and %s13, %s13, (32)0 -; PIC-NEXT: lea.sl %s11, -1(%s13, %s11) +; PIC-NEXT: lea %s11, -192(, %s11) ; PIC-NEXT: brge.l.t %s11, %s8, .LBB2_2 ; PIC-NEXT: # %bb.1: ; PIC-NEXT: ld %s61, 24(, %s14) diff --git a/llvm/test/CodeGen/VE/Scalar/stackframe_align.ll b/llvm/test/CodeGen/VE/Scalar/stackframe_align.ll index f180ae531a9d..6717e38ff132 100644 --- a/llvm/test/CodeGen/VE/Scalar/stackframe_align.ll +++ b/llvm/test/CodeGen/VE/Scalar/stackframe_align.ll @@ -17,9 +17,7 @@ define i8* @test_frame7(i8* %0) { ; CHECK-NEXT: st %s15, 24(, %s11) ; CHECK-NEXT: st %s16, 32(, %s11) ; CHECK-NEXT: or %s9, 0, %s11 -; CHECK-NEXT: lea %s13, -192 -; CHECK-NEXT: and %s13, %s13, (32)0 -; CHECK-NEXT: lea.sl %s11, -1(%s13, %s11) +; CHECK-NEXT: lea %s11, -192(, %s11) ; CHECK-NEXT: brge.l.t %s11, %s8, .LBB0_2 ; CHECK-NEXT: # %bb.1: ; CHECK-NEXT: ld %s61, 24(, %s14) @@ -48,9 +46,7 @@ define i8* @test_frame7(i8* %0) { ; CHECKFP-NEXT: st %s15, 24(, %s11) ; CHECKFP-NEXT: st %s16, 32(, %s11) ; CHECKFP-NEXT: or %s9, 0, %s11 -; CHECKFP-NEXT: lea %s13, -192 -; CHECKFP-NEXT: and %s13, %s13, (32)0 -; CHECKFP-NEXT: lea.sl %s11, -1(%s13, %s11) +; CHECKFP-NEXT: lea %s11, -192(, %s11) ; CHECKFP-NEXT: brge.l.t %s11, %s8, .LBB0_2 ; CHECKFP-NEXT: # %bb.1: ; CHECKFP-NEXT: ld %s61, 24(, %s14) @@ -90,9 +86,7 @@ define i8* @test_frame7_align8(i8* %0) { ; CHECK-NEXT: st %s15, 24(, %s11) ; CHECK-NEXT: st %s16, 32(, %s11) ; CHECK-NEXT: or %s9, 0, %s11 -; CHECK-NEXT: lea %s13, -192 -; CHECK-NEXT: and %s13, %s13, (32)0 -; CHECK-NEXT: lea.sl %s11, -1(%s13, %s11) +; CHECK-NEXT: lea %s11, -192(, %s11) ; CHECK-NEXT: brge.l.t %s11, %s8, .LBB1_2 ; CHECK-NEXT: # %bb.1: ; CHECK-NEXT: ld %s61, 24(, %s14) @@ -121,9 +115,7 @@ define i8* @test_frame7_align8(i8* %0) { ; CHECKFP-NEXT: st %s15, 24(, %s11) ; CHECKFP-NEXT: st %s16, 32(, %s11) ; CHECKFP-NEXT: or %s9, 0, %s11 -; CHECKFP-NEXT: lea %s13, -192 -; CHECKFP-NEXT: and %s13, %s13, (32)0 -; CHECKFP-NEXT: lea.sl %s11, -1(%s13, %s11) +; CHECKFP-NEXT: lea %s11, -192(, %s11) ; CHECKFP-NEXT: brge.l.t %s11, %s8, .LBB1_2 ; CHECKFP-NEXT: # %bb.1: ; CHECKFP-NEXT: ld %s61, 24(, %s14) @@ -163,9 +155,7 @@ define i8* @test_frame16_align16(i8* %0) { ; CHECK-NEXT: st %s15, 24(, %s11) ; CHECK-NEXT: st %s16, 32(, %s11) ; CHECK-NEXT: or %s9, 0, %s11 -; CHECK-NEXT: lea %s13, -192 -; CHECK-NEXT: and %s13, %s13, (32)0 -; CHECK-NEXT: lea.sl %s11, -1(%s13, %s11) +; CHECK-NEXT: lea %s11, -192(, %s11) ; CHECK-NEXT: brge.l.t %s11, %s8, .LBB2_2 ; CHECK-NEXT: # %bb.1: ; CHECK-NEXT: ld %s61, 24(, %s14) @@ -194,9 +184,7 @@ define i8* @test_frame16_align16(i8* %0) { ; CHECKFP-NEXT: st %s15, 24(, %s11) ; CHECKFP-NEXT: st %s16, 32(, %s11) ; CHECKFP-NEXT: or %s9, 0, %s11 -; CHECKFP-NEXT: lea %s13, -192 -; CHECKFP-NEXT: and %s13, %s13, (32)0 -; CHECKFP-NEXT: lea.sl %s11, -1(%s13, %s11) +; CHECKFP-NEXT: lea %s11, -192(, %s11) ; CHECKFP-NEXT: brge.l.t %s11, %s8, .LBB2_2 ; CHECKFP-NEXT: # %bb.1: ; CHECKFP-NEXT: ld %s61, 24(, %s14) @@ -237,9 +225,7 @@ define i8* @test_frame16_align32(i8* %0) { ; CHECK-NEXT: st %s15, 24(, %s11) ; CHECK-NEXT: st %s16, 32(, %s11) ; CHECK-NEXT: or %s9, 0, %s11 -; CHECK-NEXT: lea %s13, -224 -; CHECK-NEXT: and %s13, %s13, (32)0 -; CHECK-NEXT: lea.sl %s11, -1(%s13, %s11) +; CHECK-NEXT: lea %s11, -224(, %s11) ; CHECK-NEXT: and %s11, %s11, (59)1 ; CHECK-NEXT: brge.l.t %s11, %s8, .LBB3_2 ; CHECK-NEXT: # %bb.1: @@ -269,9 +255,7 @@ define i8* @test_frame16_align32(i8* %0) { ; CHECKFP-NEXT: st %s15, 24(, %s11) ; CHECKFP-NEXT: st %s16, 32(, %s11) ; CHECKFP-NEXT: or %s9, 0, %s11 -; CHECKFP-NEXT: lea %s13, -224 -; CHECKFP-NEXT: and %s13, %s13, (32)0 -; CHECKFP-NEXT: lea.sl %s11, -1(%s13, %s11) +; CHECKFP-NEXT: lea %s11, -224(, %s11) ; CHECKFP-NEXT: and %s11, %s11, (59)1 ; CHECKFP-NEXT: brge.l.t %s11, %s8, .LBB3_2 ; CHECKFP-NEXT: # %bb.1: @@ -313,9 +297,7 @@ define i8* @test_frame32_align32(i8* %0) { ; CHECK-NEXT: st %s15, 24(, %s11) ; CHECK-NEXT: st %s16, 32(, %s11) ; CHECK-NEXT: or %s9, 0, %s11 -; CHECK-NEXT: lea %s13, -224 -; CHECK-NEXT: and %s13, %s13, (32)0 -; CHECK-NEXT: lea.sl %s11, -1(%s13, %s11) +; CHECK-NEXT: lea %s11, -224(, %s11) ; CHECK-NEXT: and %s11, %s11, (59)1 ; CHECK-NEXT: brge.l.t %s11, %s8, .LBB4_2 ; CHECK-NEXT: # %bb.1: @@ -345,9 +327,7 @@ define i8* @test_frame32_align32(i8* %0) { ; CHECKFP-NEXT: st %s15, 24(, %s11) ; CHECKFP-NEXT: st %s16, 32(, %s11) ; CHECKFP-NEXT: or %s9, 0, %s11 -; CHECKFP-NEXT: lea %s13, -224 -; CHECKFP-NEXT: and %s13, %s13, (32)0 -; CHECKFP-NEXT: lea.sl %s11, -1(%s13, %s11) +; CHECKFP-NEXT: lea %s11, -224(, %s11) ; CHECKFP-NEXT: and %s11, %s11, (59)1 ; CHECKFP-NEXT: brge.l.t %s11, %s8, .LBB4_2 ; CHECKFP-NEXT: # %bb.1: @@ -393,9 +373,7 @@ define i8* @test_frame_dynalign16(i8* %0, i64 %1) { ; CHECK-NEXT: st %s15, 24(, %s11) ; CHECK-NEXT: st %s16, 32(, %s11) ; CHECK-NEXT: or %s9, 0, %s11 -; CHECK-NEXT: lea %s13, -240 -; CHECK-NEXT: and %s13, %s13, (32)0 -; CHECK-NEXT: lea.sl %s11, -1(%s13, %s11) +; CHECK-NEXT: lea %s11, -240(, %s11) ; CHECK-NEXT: brge.l.t %s11, %s8, .LBB5_2 ; CHECK-NEXT: # %bb.1: ; CHECK-NEXT: ld %s61, 24(, %s14) @@ -431,9 +409,7 @@ define i8* @test_frame_dynalign16(i8* %0, i64 %1) { ; CHECKFP-NEXT: st %s15, 24(, %s11) ; CHECKFP-NEXT: st %s16, 32(, %s11) ; CHECKFP-NEXT: or %s9, 0, %s11 -; CHECKFP-NEXT: lea %s13, -240 -; CHECKFP-NEXT: and %s13, %s13, (32)0 -; CHECKFP-NEXT: lea.sl %s11, -1(%s13, %s11) +; CHECKFP-NEXT: lea %s11, -240(, %s11) ; CHECKFP-NEXT: brge.l.t %s11, %s8, .LBB5_2 ; CHECKFP-NEXT: # %bb.1: ; CHECKFP-NEXT: ld %s61, 24(, %s14) @@ -487,9 +463,7 @@ define i8* @test_frame16_align16_dynalign32(i8* %0, i64 %n) { ; CHECK-NEXT: st %s16, 32(, %s11) ; CHECK-NEXT: st %s17, 40(, %s11) ; CHECK-NEXT: or %s9, 0, %s11 -; CHECK-NEXT: lea %s13, -288 -; CHECK-NEXT: and %s13, %s13, (32)0 -; CHECK-NEXT: lea.sl %s11, -1(%s13, %s11) +; CHECK-NEXT: lea %s11, -288(, %s11) ; CHECK-NEXT: and %s11, %s11, (59)1 ; CHECK-NEXT: or %s17, 0, %s11 ; CHECK-NEXT: brge.l.t %s11, %s8, .LBB6_2 @@ -533,9 +507,7 @@ define i8* @test_frame16_align16_dynalign32(i8* %0, i64 %n) { ; CHECKFP-NEXT: st %s16, 32(, %s11) ; CHECKFP-NEXT: st %s17, 40(, %s11) ; CHECKFP-NEXT: or %s9, 0, %s11 -; CHECKFP-NEXT: lea %s13, -288 -; CHECKFP-NEXT: and %s13, %s13, (32)0 -; CHECKFP-NEXT: lea.sl %s11, -1(%s13, %s11) +; CHECKFP-NEXT: lea %s11, -288(, %s11) ; CHECKFP-NEXT: and %s11, %s11, (59)1 ; CHECKFP-NEXT: or %s17, 0, %s11 ; CHECKFP-NEXT: brge.l.t %s11, %s8, .LBB6_2 diff --git a/llvm/test/CodeGen/VE/Scalar/stackframe_call.ll b/llvm/test/CodeGen/VE/Scalar/stackframe_call.ll index fe120d091679..3696af529d08 100644 --- a/llvm/test/CodeGen/VE/Scalar/stackframe_call.ll +++ b/llvm/test/CodeGen/VE/Scalar/stackframe_call.ll @@ -20,9 +20,7 @@ define i8* @test_frame0(i8* %0, i8* %1) { ; CHECK-NEXT: st %s15, 24(, %s11) ; CHECK-NEXT: st %s16, 32(, %s11) ; CHECK-NEXT: or %s9, 0, %s11 -; CHECK-NEXT: lea %s13, -240 -; CHECK-NEXT: and %s13, %s13, (32)0 -; CHECK-NEXT: lea.sl %s11, -1(%s13, %s11) +; CHECK-NEXT: lea %s11, -240(, %s11) ; CHECK-NEXT: brge.l.t %s11, %s8, .LBB0_2 ; CHECK-NEXT: # %bb.1: ; CHECK-NEXT: ld %s61, 24(, %s14) @@ -52,9 +50,7 @@ define i8* @test_frame0(i8* %0, i8* %1) { ; PIC-NEXT: st %s15, 24(, %s11) ; PIC-NEXT: st %s16, 32(, %s11) ; PIC-NEXT: or %s9, 0, %s11 -; PIC-NEXT: lea %s13, -240 -; PIC-NEXT: and %s13, %s13, (32)0 -; PIC-NEXT: lea.sl %s11, -1(%s13, %s11) +; PIC-NEXT: lea %s11, -240(, %s11) ; PIC-NEXT: brge.l.t %s11, %s8, .LBB0_2 ; PIC-NEXT: # %bb.1: ; PIC-NEXT: ld %s61, 24(, %s14) @@ -96,9 +92,7 @@ define i8* @test_frame32(i8* %0) { ; CHECK-NEXT: st %s15, 24(, %s11) ; CHECK-NEXT: st %s16, 32(, %s11) ; CHECK-NEXT: or %s9, 0, %s11 -; CHECK-NEXT: lea %s13, -272 -; CHECK-NEXT: and %s13, %s13, (32)0 -; CHECK-NEXT: lea.sl %s11, -1(%s13, %s11) +; CHECK-NEXT: lea %s11, -272(, %s11) ; CHECK-NEXT: brge.l.t %s11, %s8, .LBB1_2 ; CHECK-NEXT: # %bb.1: ; CHECK-NEXT: ld %s61, 24(, %s14) @@ -130,9 +124,7 @@ define i8* @test_frame32(i8* %0) { ; PIC-NEXT: st %s15, 24(, %s11) ; PIC-NEXT: st %s16, 32(, %s11) ; PIC-NEXT: or %s9, 0, %s11 -; PIC-NEXT: lea %s13, -272 -; PIC-NEXT: and %s13, %s13, (32)0 -; PIC-NEXT: lea.sl %s11, -1(%s13, %s11) +; PIC-NEXT: lea %s11, -272(, %s11) ; PIC-NEXT: brge.l.t %s11, %s8, .LBB1_2 ; PIC-NEXT: # %bb.1: ; PIC-NEXT: ld %s61, 24(, %s14) @@ -185,9 +177,7 @@ define i8* @test_align32(i32 signext %0, i8* nocapture readnone %1) { ; CHECK-NEXT: st %s16, 32(, %s11) ; CHECK-NEXT: st %s17, 40(, %s11) ; CHECK-NEXT: or %s9, 0, %s11 -; CHECK-NEXT: lea %s13, -288 -; CHECK-NEXT: and %s13, %s13, (32)0 -; CHECK-NEXT: lea.sl %s11, -1(%s13, %s11) +; CHECK-NEXT: lea %s11, -288(, %s11) ; CHECK-NEXT: and %s11, %s11, (59)1 ; CHECK-NEXT: or %s17, 0, %s11 ; CHECK-NEXT: brge.l.t %s11, %s8, .LBB2_2 @@ -232,9 +222,7 @@ define i8* @test_align32(i32 signext %0, i8* nocapture readnone %1) { ; PIC-NEXT: st %s16, 32(, %s11) ; PIC-NEXT: st %s17, 40(, %s11) ; PIC-NEXT: or %s9, 0, %s11 -; PIC-NEXT: lea %s13, -288 -; PIC-NEXT: and %s13, %s13, (32)0 -; PIC-NEXT: lea.sl %s11, -1(%s13, %s11) +; PIC-NEXT: lea %s11, -288(, %s11) ; PIC-NEXT: and %s11, %s11, (59)1 ; PIC-NEXT: or %s17, 0, %s11 ; PIC-NEXT: brge.l.t %s11, %s8, .LBB2_2 @@ -295,9 +283,7 @@ define i8* @test_frame0_var(i8* %0, i8* %1) { ; CHECK-NEXT: st %s15, 24(, %s11) ; CHECK-NEXT: st %s16, 32(, %s11) ; CHECK-NEXT: or %s9, 0, %s11 -; CHECK-NEXT: lea %s13, -240 -; CHECK-NEXT: and %s13, %s13, (32)0 -; CHECK-NEXT: lea.sl %s11, -1(%s13, %s11) +; CHECK-NEXT: lea %s11, -240(, %s11) ; CHECK-NEXT: brge.l.t %s11, %s8, .LBB3_2 ; CHECK-NEXT: # %bb.1: ; CHECK-NEXT: ld %s61, 24(, %s14) @@ -332,9 +318,7 @@ define i8* @test_frame0_var(i8* %0, i8* %1) { ; PIC-NEXT: st %s15, 24(, %s11) ; PIC-NEXT: st %s16, 32(, %s11) ; PIC-NEXT: or %s9, 0, %s11 -; PIC-NEXT: lea %s13, -240 -; PIC-NEXT: and %s13, %s13, (32)0 -; PIC-NEXT: lea.sl %s11, -1(%s13, %s11) +; PIC-NEXT: lea %s11, -240(, %s11) ; PIC-NEXT: brge.l.t %s11, %s8, .LBB3_2 ; PIC-NEXT: # %bb.1: ; PIC-NEXT: ld %s61, 24(, %s14) @@ -382,9 +366,7 @@ define i8* @test_frame32_var(i8* %0) { ; CHECK-NEXT: st %s15, 24(, %s11) ; CHECK-NEXT: st %s16, 32(, %s11) ; CHECK-NEXT: or %s9, 0, %s11 -; CHECK-NEXT: lea %s13, -272 -; CHECK-NEXT: and %s13, %s13, (32)0 -; CHECK-NEXT: lea.sl %s11, -1(%s13, %s11) +; CHECK-NEXT: lea %s11, -272(, %s11) ; CHECK-NEXT: brge.l.t %s11, %s8, .LBB4_2 ; CHECK-NEXT: # %bb.1: ; CHECK-NEXT: ld %s61, 24(, %s14) @@ -421,9 +403,7 @@ define i8* @test_frame32_var(i8* %0) { ; PIC-NEXT: st %s15, 24(, %s11) ; PIC-NEXT: st %s16, 32(, %s11) ; PIC-NEXT: or %s9, 0, %s11 -; PIC-NEXT: lea %s13, -272 -; PIC-NEXT: and %s13, %s13, (32)0 -; PIC-NEXT: lea.sl %s11, -1(%s13, %s11) +; PIC-NEXT: lea %s11, -272(, %s11) ; PIC-NEXT: brge.l.t %s11, %s8, .LBB4_2 ; PIC-NEXT: # %bb.1: ; PIC-NEXT: ld %s61, 24(, %s14) @@ -478,9 +458,7 @@ define i8* @test_align32_var(i32 signext %0, i8* nocapture readnone %1) { ; CHECK-NEXT: st %s16, 32(, %s11) ; CHECK-NEXT: st %s17, 40(, %s11) ; CHECK-NEXT: or %s9, 0, %s11 -; CHECK-NEXT: lea %s13, -288 -; CHECK-NEXT: and %s13, %s13, (32)0 -; CHECK-NEXT: lea.sl %s11, -1(%s13, %s11) +; CHECK-NEXT: lea %s11, -288(, %s11) ; CHECK-NEXT: and %s11, %s11, (59)1 ; CHECK-NEXT: or %s17, 0, %s11 ; CHECK-NEXT: brge.l.t %s11, %s8, .LBB5_2 @@ -530,9 +508,7 @@ define i8* @test_align32_var(i32 signext %0, i8* nocapture readnone %1) { ; PIC-NEXT: st %s16, 32(, %s11) ; PIC-NEXT: st %s17, 40(, %s11) ; PIC-NEXT: or %s9, 0, %s11 -; PIC-NEXT: lea %s13, -288 -; PIC-NEXT: and %s13, %s13, (32)0 -; PIC-NEXT: lea.sl %s11, -1(%s13, %s11) +; PIC-NEXT: lea %s11, -288(, %s11) ; PIC-NEXT: and %s11, %s11, (59)1 ; PIC-NEXT: or %s17, 0, %s11 ; PIC-NEXT: brge.l.t %s11, %s8, .LBB5_2 diff --git a/llvm/test/CodeGen/VE/Scalar/stackframe_nocall.ll b/llvm/test/CodeGen/VE/Scalar/stackframe_nocall.ll index 5488b25ed3b8..e7f8b23c647a 100644 --- a/llvm/test/CodeGen/VE/Scalar/stackframe_nocall.ll +++ b/llvm/test/CodeGen/VE/Scalar/stackframe_nocall.ll @@ -34,9 +34,7 @@ define nonnull i8* @test_frame32(i8* nocapture readonly %0) { ; CHECK-NEXT: st %s15, 24(, %s11) ; CHECK-NEXT: st %s16, 32(, %s11) ; CHECK-NEXT: or %s9, 0, %s11 -; CHECK-NEXT: lea %s13, -208 -; CHECK-NEXT: and %s13, %s13, (32)0 -; CHECK-NEXT: lea.sl %s11, -1(%s13, %s11) +; CHECK-NEXT: lea %s11, -208(, %s11) ; CHECK-NEXT: brge.l.t %s11, %s8, .LBB1_2 ; CHECK-NEXT: # %bb.1: ; CHECK-NEXT: ld %s61, 24(, %s14) @@ -65,9 +63,7 @@ define nonnull i8* @test_frame32(i8* nocapture readonly %0) { ; PIC-NEXT: st %s15, 24(, %s11) ; PIC-NEXT: st %s16, 32(, %s11) ; PIC-NEXT: or %s9, 0, %s11 -; PIC-NEXT: lea %s13, -208 -; PIC-NEXT: and %s13, %s13, (32)0 -; PIC-NEXT: lea.sl %s11, -1(%s13, %s11) +; PIC-NEXT: lea %s11, -208(, %s11) ; PIC-NEXT: brge.l.t %s11, %s8, .LBB1_2 ; PIC-NEXT: # %bb.1: ; PIC-NEXT: ld %s61, 24(, %s14) @@ -113,9 +109,7 @@ define noalias nonnull i8* @test_align32(i32 signext %0, i8* nocapture readonly ; CHECK-NEXT: st %s16, 32(, %s11) ; CHECK-NEXT: st %s17, 40(, %s11) ; CHECK-NEXT: or %s9, 0, %s11 -; CHECK-NEXT: lea %s13, -288 -; CHECK-NEXT: and %s13, %s13, (32)0 -; CHECK-NEXT: lea.sl %s11, -1(%s13, %s11) +; CHECK-NEXT: lea %s11, -288(, %s11) ; CHECK-NEXT: and %s11, %s11, (59)1 ; CHECK-NEXT: or %s17, 0, %s11 ; CHECK-NEXT: brge.l.t %s11, %s8, .LBB2_2 @@ -159,9 +153,7 @@ define noalias nonnull i8* @test_align32(i32 signext %0, i8* nocapture readonly ; PIC-NEXT: st %s16, 32(, %s11) ; PIC-NEXT: st %s17, 40(, %s11) ; PIC-NEXT: or %s9, 0, %s11 -; PIC-NEXT: lea %s13, -288 -; PIC-NEXT: and %s13, %s13, (32)0 -; PIC-NEXT: lea.sl %s11, -1(%s13, %s11) +; PIC-NEXT: lea %s11, -288(, %s11) ; PIC-NEXT: and %s11, %s11, (59)1 ; PIC-NEXT: or %s17, 0, %s11 ; PIC-NEXT: brge.l.t %s11, %s8, .LBB2_2 @@ -230,9 +222,7 @@ define i8* @test_frame0_var(i8* returned %0, i8* nocapture readnone %1) { ; PIC-NEXT: st %s15, 24(, %s11) ; PIC-NEXT: st %s16, 32(, %s11) ; PIC-NEXT: or %s9, 0, %s11 -; PIC-NEXT: lea %s13, -176 -; PIC-NEXT: and %s13, %s13, (32)0 -; PIC-NEXT: lea.sl %s11, -1(%s13, %s11) +; PIC-NEXT: lea %s11, -176(, %s11) ; PIC-NEXT: brge.l.t %s11, %s8, .LBB3_2 ; PIC-NEXT: # %bb.1: ; PIC-NEXT: ld %s61, 24(, %s14) @@ -274,9 +264,7 @@ define nonnull i8* @test_frame32_var(i8* nocapture readnone %0) { ; CHECK-NEXT: st %s15, 24(, %s11) ; CHECK-NEXT: st %s16, 32(, %s11) ; CHECK-NEXT: or %s9, 0, %s11 -; CHECK-NEXT: lea %s13, -208 -; CHECK-NEXT: and %s13, %s13, (32)0 -; CHECK-NEXT: lea.sl %s11, -1(%s13, %s11) +; CHECK-NEXT: lea %s11, -208(, %s11) ; CHECK-NEXT: brge.l.t %s11, %s8, .LBB4_2 ; CHECK-NEXT: # %bb.1: ; CHECK-NEXT: ld %s61, 24(, %s14) @@ -308,9 +296,7 @@ define nonnull i8* @test_frame32_var(i8* nocapture readnone %0) { ; PIC-NEXT: st %s15, 24(, %s11) ; PIC-NEXT: st %s16, 32(, %s11) ; PIC-NEXT: or %s9, 0, %s11 -; PIC-NEXT: lea %s13, -208 -; PIC-NEXT: and %s13, %s13, (32)0 -; PIC-NEXT: lea.sl %s11, -1(%s13, %s11) +; PIC-NEXT: lea %s11, -208(, %s11) ; PIC-NEXT: brge.l.t %s11, %s8, .LBB4_2 ; PIC-NEXT: # %bb.1: ; PIC-NEXT: ld %s61, 24(, %s14) @@ -358,9 +344,7 @@ define noalias nonnull i8* @test_align32_var(i32 signext %0, i8* nocapture reado ; CHECK-NEXT: st %s16, 32(, %s11) ; CHECK-NEXT: st %s17, 40(, %s11) ; CHECK-NEXT: or %s9, 0, %s11 -; CHECK-NEXT: lea %s13, -288 -; CHECK-NEXT: and %s13, %s13, (32)0 -; CHECK-NEXT: lea.sl %s11, -1(%s13, %s11) +; CHECK-NEXT: lea %s11, -288(, %s11) ; CHECK-NEXT: and %s11, %s11, (59)1 ; CHECK-NEXT: or %s17, 0, %s11 ; CHECK-NEXT: brge.l.t %s11, %s8, .LBB5_2 @@ -404,9 +388,7 @@ define noalias nonnull i8* @test_align32_var(i32 signext %0, i8* nocapture reado ; PIC-NEXT: st %s16, 32(, %s11) ; PIC-NEXT: st %s17, 40(, %s11) ; PIC-NEXT: or %s9, 0, %s11 -; PIC-NEXT: lea %s13, -288 -; PIC-NEXT: and %s13, %s13, (32)0 -; PIC-NEXT: lea.sl %s11, -1(%s13, %s11) +; PIC-NEXT: lea %s11, -288(, %s11) ; PIC-NEXT: and %s11, %s11, (59)1 ; PIC-NEXT: or %s17, 0, %s11 ; PIC-NEXT: brge.l.t %s11, %s8, .LBB5_2 diff --git a/llvm/test/CodeGen/VE/Scalar/stackframe_size.ll b/llvm/test/CodeGen/VE/Scalar/stackframe_size.ll index 2443023322d1..5919b6f479fb 100644 --- a/llvm/test/CodeGen/VE/Scalar/stackframe_size.ll +++ b/llvm/test/CodeGen/VE/Scalar/stackframe_size.ll @@ -24,9 +24,7 @@ define i8* @test_frame8(i8* %0) { ; CHECK-NEXT: st %s15, 24(, %s11) ; CHECK-NEXT: st %s16, 32(, %s11) ; CHECK-NEXT: or %s9, 0, %s11 -; CHECK-NEXT: lea %s13, -192 -; CHECK-NEXT: and %s13, %s13, (32)0 -; CHECK-NEXT: lea.sl %s11, -1(%s13, %s11) +; CHECK-NEXT: lea %s11, -192(, %s11) ; CHECK-NEXT: brge.l.t %s11, %s8, .LBB1_2 ; CHECK-NEXT: # %bb.1: ; CHECK-NEXT: ld %s61, 24(, %s14) @@ -63,9 +61,7 @@ define i8* @test_frame16(i8* %0) { ; CHECK-NEXT: st %s15, 24(, %s11) ; CHECK-NEXT: st %s16, 32(, %s11) ; CHECK-NEXT: or %s9, 0, %s11 -; CHECK-NEXT: lea %s13, -192 -; CHECK-NEXT: and %s13, %s13, (32)0 -; CHECK-NEXT: lea.sl %s11, -1(%s13, %s11) +; CHECK-NEXT: lea %s11, -192(, %s11) ; CHECK-NEXT: brge.l.t %s11, %s8, .LBB2_2 ; CHECK-NEXT: # %bb.1: ; CHECK-NEXT: ld %s61, 24(, %s14) @@ -102,9 +98,7 @@ define i8* @test_frame32(i8* %0) { ; CHECK-NEXT: st %s15, 24(, %s11) ; CHECK-NEXT: st %s16, 32(, %s11) ; CHECK-NEXT: or %s9, 0, %s11 -; CHECK-NEXT: lea %s13, -208 -; CHECK-NEXT: and %s13, %s13, (32)0 -; CHECK-NEXT: lea.sl %s11, -1(%s13, %s11) +; CHECK-NEXT: lea %s11, -208(, %s11) ; CHECK-NEXT: brge.l.t %s11, %s8, .LBB3_2 ; CHECK-NEXT: # %bb.1: ; CHECK-NEXT: ld %s61, 24(, %s14) @@ -141,9 +135,7 @@ define i8* @test_frame64(i8* %0) { ; CHECK-NEXT: st %s15, 24(, %s11) ; CHECK-NEXT: st %s16, 32(, %s11) ; CHECK-NEXT: or %s9, 0, %s11 -; CHECK-NEXT: lea %s13, -240 -; CHECK-NEXT: and %s13, %s13, (32)0 -; CHECK-NEXT: lea.sl %s11, -1(%s13, %s11) +; CHECK-NEXT: lea %s11, -240(, %s11) ; CHECK-NEXT: brge.l.t %s11, %s8, .LBB4_2 ; CHECK-NEXT: # %bb.1: ; CHECK-NEXT: ld %s61, 24(, %s14) @@ -180,9 +172,7 @@ define i8* @test_frame128(i8* %0) { ; CHECK-NEXT: st %s15, 24(, %s11) ; CHECK-NEXT: st %s16, 32(, %s11) ; CHECK-NEXT: or %s9, 0, %s11 -; CHECK-NEXT: lea %s13, -304 -; CHECK-NEXT: and %s13, %s13, (32)0 -; CHECK-NEXT: lea.sl %s11, -1(%s13, %s11) +; CHECK-NEXT: lea %s11, -304(, %s11) ; CHECK-NEXT: brge.l.t %s11, %s8, .LBB5_2 ; CHECK-NEXT: # %bb.1: ; CHECK-NEXT: ld %s61, 24(, %s14) @@ -219,9 +209,7 @@ define i8* @test_frame65536(i8* %0) { ; CHECK-NEXT: st %s15, 24(, %s11) ; CHECK-NEXT: st %s16, 32(, %s11) ; CHECK-NEXT: or %s9, 0, %s11 -; CHECK-NEXT: lea %s13, -65712 -; CHECK-NEXT: and %s13, %s13, (32)0 -; CHECK-NEXT: lea.sl %s11, -1(%s13, %s11) +; CHECK-NEXT: lea %s11, -65712(, %s11) ; CHECK-NEXT: brge.l.t %s11, %s8, .LBB6_2 ; CHECK-NEXT: # %bb.1: ; CHECK-NEXT: ld %s61, 24(, %s14)