Use tPseudoExpand for tTAILJMPrND and tTAILJMPr.
authorJim Grosbach <grosbach@apple.com>
Fri, 8 Jul 2011 20:39:19 +0000 (20:39 +0000)
committerJim Grosbach <grosbach@apple.com>
Fri, 8 Jul 2011 20:39:19 +0000 (20:39 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134734 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/ARMAsmPrinter.cpp
lib/Target/ARM/ARMInstrThumb.td

index 3a891c48c8c2464166f82258f6673120532a32eb..dbc3ee41f3da8536d4a791f718acd55d71cb1407 100644 (file)
@@ -1799,20 +1799,6 @@ void ARMAsmPrinter::EmitInstruction(const MachineInstr *MI) {
     }
     return;
   }
-  // Tail jump branches are really just branch instructions with additional
-  // code-gen attributes. Convert them to the canonical form here.
-  case ARM::tTAILJMPrND:
-  case ARM::tTAILJMPr: {
-    MCInst TmpInst;
-    TmpInst.setOpcode(ARM::tBX);
-    TmpInst.addOperand(MCOperand::CreateReg(MI->getOperand(0).getReg()));
-    // Predicate.
-    TmpInst.addOperand(MCOperand::CreateImm(ARMCC::AL));
-    TmpInst.addOperand(MCOperand::CreateReg(0));
-    OutStreamer.AddComment("TAILCALL");
-    OutStreamer.EmitInstruction(TmpInst);
-    return;
-  }
   }
 
   MCInst TmpInst;
index 433d6b10331e71dda57217200f8222079f12badb..c3fb83db47c6a2e6760ef719fe484ba71b5cec7e 100644 (file)
@@ -578,9 +578,10 @@ let isCall = 1, isTerminator = 1, isReturn = 1, isBarrier = 1 in {
       Uses = [SP] in {
     // tTAILJMPd: Darwin version uses a Thumb2 branch (no Thumb1 tail calls
     // on Darwin), so it's in ARMInstrThumb2.td.
-    def tTAILJMPr : tPseudoInst<(outs), (ins tcGPR:$dst, variable_ops),
-                     Size4Bytes, IIC_Br,
-                   []>, Requires<[IsThumb, IsDarwin]>;
+    def tTAILJMPr : tPseudoExpand<(outs), (ins tcGPR:$dst, variable_ops),
+                     Size4Bytes, IIC_Br, [],
+                     (tBX GPR:$dst, (ops 14, zero_reg))>,
+                     Requires<[IsThumb, IsDarwin]>;
   }
   // Non-Darwin versions (the difference is R9).
   let Defs = [R0, R1, R2, R3, R12, QQQQ0, QQQQ2, QQQQ3, PC],
@@ -589,9 +590,10 @@ let isCall = 1, isTerminator = 1, isReturn = 1, isBarrier = 1 in {
                    Size4Bytes, IIC_Br, [],
                    (tB t_brtarget:$dst)>,
                  Requires<[IsThumb, IsNotDarwin]>;
-    def tTAILJMPrND : tPseudoInst<(outs), (ins tcGPR:$dst, variable_ops),
-                     Size4Bytes, IIC_Br,
-                   []>, Requires<[IsThumb, IsNotDarwin]>;
+    def tTAILJMPrND : tPseudoExpand<(outs), (ins tcGPR:$dst, variable_ops),
+                     Size4Bytes, IIC_Br, [],
+                     (tBX GPR:$dst, (ops 14, zero_reg))>,
+                     Requires<[IsThumb, IsNotDarwin]>;
   }
 }