From ee1590f5f00411a81262756843ae4eb4f57f8a96 Mon Sep 17 00:00:00 2001 From: Simon Dardis Date: Tue, 12 Apr 2016 12:22:45 +0000 Subject: [PATCH] Revert "[mips] MIPSR6 Compact branch aliases" This reverts commit r266055. ps4-buildslave2 is highlighting a failure. llvm-svn: 266061 --- llvm/lib/Target/Mips/Mips32r6InstrInfo.td | 5 +- llvm/lib/Target/Mips/Mips64r6InstrInfo.td | 3 -- .../Mips/compactbranches/compact-branches.ll | 60 +++++++++++----------- llvm/test/CodeGen/Mips/llvm-ir/call.ll | 22 +++----- llvm/test/CodeGen/Mips/llvm-ir/indirectbr.ll | 2 +- llvm/test/CodeGen/Mips/llvm-ir/ret.ll | 8 +-- llvm/test/CodeGen/Mips/mips64-f128.ll | 10 ++-- .../Mips/mips32r6/valid-mips32r6-el.txt | 2 - .../Disassembler/Mips/mips32r6/valid-mips32r6.txt | 2 - .../Mips/mips64r6/valid-mips64r6-el.txt | 2 - .../Disassembler/Mips/mips64r6/valid-mips64r6.txt | 2 - llvm/test/MC/Mips/mips32r6/valid.s | 2 - llvm/test/MC/Mips/mips64r6/valid.s | 2 - 13 files changed, 49 insertions(+), 73 deletions(-) diff --git a/llvm/lib/Target/Mips/Mips32r6InstrInfo.td b/llvm/lib/Target/Mips/Mips32r6InstrInfo.td index 337975c..3e2c829 100644 --- a/llvm/lib/Target/Mips/Mips32r6InstrInfo.td +++ b/llvm/lib/Target/Mips/Mips32r6InstrInfo.td @@ -815,11 +815,8 @@ def SWC2_R6 : SWC2_R6_ENC, SWC2_R6_DESC, ISA_MIPS32R6; let AdditionalPredicates = [NotInMicroMips] in { def : MipsInstAlias<"sdbbp", (SDBBP_R6 0)>, ISA_MIPS32R6; } -def : MipsInstAlias<"jr $rs", (JALR ZERO, GPR32Opnd:$rs), 1>, ISA_MIPS32R6, GPR_32; +def : MipsInstAlias<"jr $rs", (JALR ZERO, GPR32Opnd:$rs), 1>, ISA_MIPS32R6; -def : MipsInstAlias<"jrc $rs", (JIC GPR32Opnd:$rs, 0), 1>, ISA_MIPS32R6, GPR_32; - -def : MipsInstAlias<"jalrc $rs", (JIALC GPR32Opnd:$rs, 0), 1>, ISA_MIPS32R6, GPR_32; //===----------------------------------------------------------------------===// // // Patterns and Pseudo Instructions diff --git a/llvm/lib/Target/Mips/Mips64r6InstrInfo.td b/llvm/lib/Target/Mips/Mips64r6InstrInfo.td index f9e5154..d11f2a2 100644 --- a/llvm/lib/Target/Mips/Mips64r6InstrInfo.td +++ b/llvm/lib/Target/Mips/Mips64r6InstrInfo.td @@ -131,9 +131,6 @@ def JIC64 : JIC_ENC, JIC64_DESC, ISA_MIPS64R6; def : MipsInstAlias<"jr $rs", (JALR64 ZERO_64, GPR64Opnd:$rs), 1>, ISA_MIPS64R6; -def : MipsInstAlias<"jrc $rs", (JIC64 GPR64Opnd:$rs, 0), 1>, ISA_MIPS64R6; - -def : MipsInstAlias<"jalrc $rs", (JIALC64 GPR64Opnd:$rs, 0), 1>, ISA_MIPS64R6; //===----------------------------------------------------------------------===// // // Patterns and Pseudo Instructions diff --git a/llvm/test/CodeGen/Mips/compactbranches/compact-branches.ll b/llvm/test/CodeGen/Mips/compactbranches/compact-branches.ll index a7e9219..b489a23 100644 --- a/llvm/test/CodeGen/Mips/compactbranches/compact-branches.ll +++ b/llvm/test/CodeGen/Mips/compactbranches/compact-branches.ll @@ -4,9 +4,9 @@ ; Function Attrs: nounwind define void @l() { entry: -; PIC: jalrc $25 +; PIC: jialc $25, 0 %call = tail call i32 @k() -; PIC: jalrc $25 +; PIC: jialc $25, 0 %call1 = tail call i32 @j() %cmp = icmp eq i32 %call, %call1 ; CHECK: bnec @@ -15,12 +15,12 @@ entry: if.then: ; preds = %entry: ; STATIC: nop ; STATIC: jal -; PIC: jalrc $25 +; PIC: jialc $25, 0 tail call void @f(i32 signext -2) br label %if.end if.end: ; preds = %if.then, %entry -; CHECK: jrc $ra +; CHECK: jic $ra, 0 ret void } @@ -33,9 +33,9 @@ declare void @f(i32 signext) ; Function Attrs: define void @l2() { define void @l2() { entry: -; PIC: jalrc $25 +; PIC: jialc $25, 0 %call = tail call i32 @k() -; PIC: jalrc $25 +; PIC: jialc $25, 0 %call1 = tail call i32 @i() %cmp = icmp eq i32 %call, %call1 ; CHECK beqc @@ -44,12 +44,12 @@ entry: if.then: ; preds = %entry: ; STATIC: nop ; STATIC: jal -; PIC: jalrc $25 +; PIC: jialc $25, 0 tail call void @f(i32 signext -1) br label %if.end if.end: ; preds = %entry, %if.then -; CHECK: jrc $ra +; CHECK: jic $ra, 0 ret void } @@ -58,7 +58,7 @@ declare i32 @i() ; Function Attrs: nounwind define void @l3() { entry: -; PIC: jalrc $25 +; PIC: jialc $25, 0 %call = tail call i32 @k() %cmp = icmp slt i32 %call, 0 ; CHECK : bgez @@ -67,12 +67,12 @@ entry: if.then: ; preds = %entry: ; STATIC: nop ; STATIC: jal -; PIC: jalrc $25 +; PIC: jialc $25, 0 tail call void @f(i32 signext 0) br label %if.end if.end: ; preds = %if.then, %entry -; CHECK: jrc $ra +; CHECK: jic $ra, 0 ret void } @@ -91,16 +91,16 @@ if.then: ; preds = %entry: br label %if.end if.end: ; preds = %if.then, %entry -; CHECK: jrc $ra +; CHECK: jic $ra, 0 ret void } ; Function Attrs: nounwind define void @l5() { entry: -; PIC: jalrc $25 +; PIC: jialc $25, 0 %call = tail call i32 @k() -; PIC: jalrc $25 +; PIC: jialc $25, 0 %cmp = icmp sgt i32 %call, 0 ; CHECK: blezc br i1 %cmp, label %if.then, label %if.end @@ -108,21 +108,21 @@ entry: if.then: ; preds = %entry: ; STATIC: nop ; STATIC: jal -; PIC: jalrc $25 +; PIC: jialc $25, 0 tail call void @f(i32 signext 2) br label %if.end if.end: ; preds = %if.then, %entry -; CHECK: jrc $ra +; CHECK: jic $ra, 0 ret void } ; Function Attrs: nounwind define void @l6() { entry: -; PIC: jalrc $25 +; PIC: jialc $25, 0 %call = tail call i32 @k() -; PIC: jalrc $25 +; PIC: jialc $25, 0 %cmp = icmp sgt i32 %call, -1 ; CHECK: bltzc br i1 %cmp, label %if.then, label %if.end @@ -130,19 +130,19 @@ entry: if.then: ; preds = %entry: ; STATIC: nop ; STATIC: jal -; PIC: jalrc $25 +; PIC: jialc $25, 0 tail call void @f(i32 signext 3) br label %if.end if.end: ; preds = %if.then, %entry -; CHECK: jrc $ra +; CHECK: jic $ra, 0 ret void } ; Function Attrs: nounwind define void @l7() { entry: -; PIC: jalrc $25 +; PIC: jialc $25, 0 %call = tail call i32 @k() %cmp = icmp eq i32 %call, 0 ; CHECK: bnezc @@ -151,19 +151,19 @@ entry: if.then: ; preds = %entry: ; STATIC: nop ; STATIC: jal -; PIC: jalrc $25 +; PIC: jialc $25, 0 tail call void @f(i32 signext 4) br label %if.end if.end: ; preds = %if.then, %entry -; CHECK: jrc $ra +; CHECK: jic $ra, 0 ret void } ; Function Attrs: nounwind define void @l8() { entry: -; PIC: jalrc $25 +; PIC: jialc $25, 0 %call = tail call i32 @k() %cmp = icmp eq i32 %call, 0 ; CHECK: beqzc @@ -172,12 +172,12 @@ entry: if.then: ; preds = %entry: ; STATIC: nop ; STATIC: jal -; PIC: jalrc $25 +; PIC: jialc $25, 0 tail call void @f(i32 signext 5) br label %if.end if.end: ; preds = %entry, %if.then -; CHECK: jrc $ra +; CHECK: jic $ra, 0 ret void } @@ -187,20 +187,20 @@ entry: store i8* ()* %i, i8* ()** %i.addr, align 4 ; STATIC32: jal ; STATIC32: nop -; PIC: jalrc $25 +; PIC: jialc $25, 0 %call = call i32 @k() -; PIC: jalrc $25 +; PIC: jialc $25, 0 %cmp = icmp ne i32 %call, 0 ; CHECK: beqzc br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry %0 = load i8* ()*, i8* ()** %i.addr, align 4 -; CHECK: jalrc $25 +; CHECK: jialc $25, 0 %call1 = call i8* %0() br label %if.end if.end: ; preds = %if.then, %entry -; CHECK: jrc $ra +; CHECK: jic $ra, 0 ret i32 -1 } diff --git a/llvm/test/CodeGen/Mips/llvm-ir/call.ll b/llvm/test/CodeGen/Mips/llvm-ir/call.ll index 063b746..da3ffaf 100644 --- a/llvm/test/CodeGen/Mips/llvm-ir/call.ll +++ b/llvm/test/CodeGen/Mips/llvm-ir/call.ll @@ -26,10 +26,9 @@ define i32 @call_void_void() { ; N64: ld $[[TGT:[0-9]+]], %call16(extern_void_void)($gp) ; NOT-R6C: jalr $[[TGT]] -; R6C: jalrc $[[TGT]] +; R6C: jialc $[[TGT]], 0 call void @extern_void_void() -; R6C: jrc $ra ret i32 0 } @@ -41,11 +40,10 @@ define i32 @call_i32_void() { ; N64: ld $[[TGT:[0-9]+]], %call16(extern_i32_void)($gp) ; NOT-R6C: jalr $[[TGT]] -; R6C: jalrc $[[TGT]] +; R6C: jialc $[[TGT]], 0 %1 = call i32 @extern_i32_void() %2 = add i32 %1, 1 -; R6C: jrc $ra ret i32 %2 } @@ -60,12 +58,11 @@ define float @call_float_void() { ; N64: ld $[[TGT:[0-9]+]], %call16(extern_float_void)($gp) ; NOT-R6C: jalr $[[TGT]] -; R6C: jalrc $[[TGT]] +; R6C: jialc $[[TGT]], 0 %1 = call float @extern_float_void() %2 = fadd float %1, 1.0 -; R6C: jrc $ra ret float %2 } @@ -113,10 +110,10 @@ define i32 @indirect_call_void_void(void ()* %addr) { ; ALL: move $25, $4 ; NOT-R6C: jalr $25 -; R6C: jalrc $25 +; R6C: jialc $25, 0 + call void %addr() -; R6C: jrc $ra ret i32 0 } @@ -125,12 +122,11 @@ define i32 @indirect_call_i32_void(i32 ()* %addr) { ; ALL: move $25, $4 ; NOT-R6C: jalr $25 -; R6C: jalrc $25 +; R6C: jialc $25, 0 %1 = call i32 %addr() %2 = add i32 %1, 1 -; R6C: jrc $ra ret i32 %2 } @@ -139,12 +135,11 @@ define float @indirect_call_float_void(float ()* %addr) { ; ALL: move $25, $4 ; NOT-R6C: jalr $25 -; R6C: jalrc $25 +; R6C: jialc $25, 0 %1 = call float %addr() %2 = fadd float %1, 1.0 -; R6C: jrc $ra ret float %2 } @@ -202,11 +197,10 @@ define i32 @jal_only_allows_symbols() { ; ALL: addiu $[[TGT:[0-9]+]], $zero, 1234 ; ALL-NOT: {{jal }} ; NOT-R6C: jalr $[[TGT]] -; R6C: jalrc $[[TGT]] +; R6C: jialc $[[TGT]], 0 ; ALL-NOT: {{jal }} call void () inttoptr (i32 1234 to void ()*)() -; R6C: jrc $ra ret i32 0 } diff --git a/llvm/test/CodeGen/Mips/llvm-ir/indirectbr.ll b/llvm/test/CodeGen/Mips/llvm-ir/indirectbr.ll index 26c02ed..4fdce5a 100644 --- a/llvm/test/CodeGen/Mips/llvm-ir/indirectbr.ll +++ b/llvm/test/CodeGen/Mips/llvm-ir/indirectbr.ll @@ -15,7 +15,7 @@ define i32 @br(i8 *%addr) { ; ALL-LABEL: br: ; NOT-R6: jr $4 #