[mips][mips64r6] Use JALR for indirect branches instead of JR (which is not available...
[oota-llvm.git] / lib / Target / Mips / Mips16InstrInfo.td
index 11166c45a880eb4b9031916722b4e866a2ecf070..5e4eebb62c1248b0198b71c7a1d3451c0f69ecc9 100644 (file)
@@ -1370,9 +1370,11 @@ def : Mips16Pat<(MipsJmpLink (i32 texternalsym:$dst)),
                 (Jal16 texternalsym:$dst)>;
 
 // Indirect branch
-def: Mips16Pat<
-  (brind CPU16Regs:$rs),
-  (JrcRx16 CPU16Regs:$rs)>;
+def: Mips16Pat<(brind CPU16Regs:$rs), (JrcRx16 CPU16Regs:$rs)> {
+  // Ensure that the addition of MIPS32r6/MIPS64r6 support does not change
+  // MIPS16's behaviour.
+  let AddedComplexity = 1;
+}
 
 // Jump and Link (Call)
 let isCall=1, hasDelaySlot=0 in