summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorReed Kotler <rkotler@mips.com>2012-10-30 00:54:49 +0000
committerReed Kotler <rkotler@mips.com>2012-10-30 00:54:49 +0000
commita81175371628fd34b10bfcc03c1c7dbe9a62621a (patch)
tree844eef58a2e12cb80e03879b4753b21895a74eaf
parent73ddcfe03fd05af2d86465eef4d38ab739400c78 (diff)
downloadbcm5719-llvm-a81175371628fd34b10bfcc03c1c7dbe9a62621a.tar.gz
bcm5719-llvm-a81175371628fd34b10bfcc03c1c7dbe9a62621a.zip
Change mips16 delay slot jumps to non delay slot forms by default.
We will make them delay slot forms if there is something that can be placed in the delay slot during a separate pass. Mips16 extended instructions cannot be placed in delay slots. llvm-svn: 166990
-rw-r--r--llvm/lib/Target/Mips/Mips16InstrInfo.cpp2
-rw-r--r--llvm/lib/Target/Mips/Mips16InstrInfo.td11
-rw-r--r--llvm/test/CodeGen/Mips/helloworld.ll4
-rw-r--r--llvm/test/CodeGen/Mips/null.ll2
4 files changed, 13 insertions, 6 deletions
diff --git a/llvm/lib/Target/Mips/Mips16InstrInfo.cpp b/llvm/lib/Target/Mips/Mips16InstrInfo.cpp
index 5e33fed0cc9..fa0876a4ebe 100644
--- a/llvm/lib/Target/Mips/Mips16InstrInfo.cpp
+++ b/llvm/lib/Target/Mips/Mips16InstrInfo.cpp
@@ -126,7 +126,7 @@ bool Mips16InstrInfo::expandPostRAPseudo(MachineBasicBlock::iterator MI) const {
default:
return false;
case Mips::RetRA16:
- ExpandRetRA16(MBB, MI, Mips::JrRa16);
+ ExpandRetRA16(MBB, MI, Mips::JrcRa16);
break;
}
diff --git a/llvm/lib/Target/Mips/Mips16InstrInfo.td b/llvm/lib/Target/Mips/Mips16InstrInfo.td
index 2740a1d83a8..5f8af05f0c5 100644
--- a/llvm/lib/Target/Mips/Mips16InstrInfo.td
+++ b/llvm/lib/Target/Mips/Mips16InstrInfo.td
@@ -515,6 +515,13 @@ def JrRa16: FRR16_JALRC_RA_only_ins<0, 0, "jr", IIAlu> {
let isBarrier=1;
}
+def JrcRa16: FRR16_JALRC_RA_only_ins<0, 0, "jrc", IIAlu> {
+ let isBranch = 1;
+ let isIndirectBranch = 1;
+ let isTerminator=1;
+ let isBarrier=1;
+}
+
def JrcRx16: FRR16_JALRC_ins<1, 1, 0, "jrc", IIAlu> {
let isBranch = 1;
let isIndirectBranch = 1;
@@ -1011,10 +1018,10 @@ def: Mips16Pat<
// Jump and Link (Call)
-let isCall=1, hasDelaySlot=1 in
+let isCall=1, hasDelaySlot=0 in
def JumpLinkReg16:
FRR16_JALRC<0, 0, 0, (outs), (ins CPU16Regs:$rs),
- "jalr \t$rs", [(MipsJmpLink CPU16Regs:$rs)], IIBranch>;
+ "jalrc \t$rs", [(MipsJmpLink CPU16Regs:$rs)], IIBranch>;
// Mips16 pseudos
let isReturn=1, isTerminator=1, hasDelaySlot=1, isBarrier=1, hasCtrlDep=1,
diff --git a/llvm/test/CodeGen/Mips/helloworld.ll b/llvm/test/CodeGen/Mips/helloworld.ll
index bee93accd42..aee58b650e7 100644
--- a/llvm/test/CodeGen/Mips/helloworld.ll
+++ b/llvm/test/CodeGen/Mips/helloworld.ll
@@ -24,10 +24,10 @@ entry:
; C1: addiu ${{[0-9]+}}, %lo($.str)
; C2: move $25, ${{[0-9]+}}
; C1: move $gp, ${{[0-9]+}}
-; C1: jalr ${{[0-9]+}}
+; C1: jalrc ${{[0-9]+}}
; SR: restore $ra, [[FS]]
; PE: li $2, 0
-; PE: jr $ra
+; PE: jrc $ra
}
diff --git a/llvm/test/CodeGen/Mips/null.ll b/llvm/test/CodeGen/Mips/null.ll
index 7beae99c455..00c66a9928f 100644
--- a/llvm/test/CodeGen/Mips/null.ll
+++ b/llvm/test/CodeGen/Mips/null.ll
@@ -8,6 +8,6 @@ entry:
; 16: .set mips16 # @main
-; 16: jr $ra
+; 16: jrc $ra
}
OpenPOWER on IntegriCloud