[Sparc] Do not hardcode nop in the delay slot of TLS_CALL. Use DelaySlotFiller to...
authorVenkatraman Govindaraju <venkatra@cs.wisc.edu>
Tue, 8 Oct 2013 02:50:29 +0000 (02:50 +0000)
committerVenkatraman Govindaraju <venkatra@cs.wisc.edu>
Tue, 8 Oct 2013 02:50:29 +0000 (02:50 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192160 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Sparc/DelaySlotFiller.cpp
lib/Target/Sparc/SparcInstrInfo.td

index 4ae6407b1f45d3d84109759b50bd8508560618ec..9a0466aa692d40b41ea854b6366d7fdf5701f270 100644 (file)
@@ -169,7 +169,7 @@ Filler::findDelayInstr(MachineBasicBlock &MBB,
   if (slot == MBB.begin())
     return MBB.end();
 
-  if (slot->getOpcode() == SP::RET)
+  if (slot->getOpcode() == SP::RET || slot->getOpcode() == SP::TLS_CALL)
     return MBB.end();
 
   if (slot->getOpcode() == SP::RETL) {
@@ -355,6 +355,7 @@ bool Filler::needsUnimp(MachineBasicBlock::iterator I, unsigned &StructSize)
   case SP::CALL: structSizeOpNum = 1; break;
   case SP::JMPLrr:
   case SP::JMPLri: structSizeOpNum = 2; break;
+  case SP::TLS_CALL: return false;
   }
 
   const MachineOperand &MO = I->getOperand(structSizeOpNum);
index e6a9cf53d18a880046a967ce3b231a19bf866e76..9b74147d3e29c6f14df96f05d657354e4e57b66f 100644 (file)
@@ -845,10 +845,10 @@ let mayLoad = 1 in
                       [(set i32:$dst,
                           (tlsld ADDRrr:$addr, tglobaltlsaddr:$sym))]>;
 
-let Uses = [O6], isCall = 1 in
+let Uses = [O6], isCall = 1, hasDelaySlot = 1 in
   def TLS_CALL : InstSP<(outs),
                         (ins calltarget:$disp, TLSSym:$sym, variable_ops),
-                        "call $disp, $sym\n\tnop",
+                        "call $disp, $sym",
                         [(tlscall texternalsym:$disp, tglobaltlsaddr:$sym)]> {
   bits<30> disp;
   let op = 1;