]> granicus.if.org Git - llvm/commitdiff
[XRay][Arm32] Reduce the portion of the stub and implement more staging for tail...
authorSerge Rogatch <srogatch@accesssoftek.com>
Thu, 26 Jan 2017 16:17:03 +0000 (16:17 +0000)
committerSerge Rogatch <srogatch@accesssoftek.com>
Thu, 26 Jan 2017 16:17:03 +0000 (16:17 +0000)
Summary:
This patch provides more staging for tail calls in XRay Arm32 . When the logging part of XRay is ready for tail calls, its support in the core part of XRay Arm32 may be as easy as changing the number passed to the handler from 1 to 2.
Coupled patch:
- https://reviews.llvm.org/D28674

Reviewers: dberris, rengolin

Reviewed By: dberris

Subscribers: llvm-commits, iid_iunknown, aemerson, rengolin, dberris

Differential Revision: https://reviews.llvm.org/D28673

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293185 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/ARMBaseInstrInfo.cpp
lib/Target/ARM/ARMBaseInstrInfo.h

index 28ad31845569698a45804f35e690bdcb7d004a72..e42f4007f3424496fcd1ec2a9b0e1c60bf296436 100644 (file)
@@ -4696,6 +4696,19 @@ bool ARMBaseInstrInfo::hasNOP() const {
   return Subtarget.getFeatureBits()[ARM::HasV6KOps];
 }
 
+bool ARMBaseInstrInfo::isTailCall(const MachineInstr &Inst) const
+{
+  switch (Inst.getOpcode()) {
+  case ARM::TAILJMPd:
+  case ARM::TAILJMPr:
+  case ARM::TCRETURNdi:
+  case ARM::TCRETURNri:
+    return true;
+  default:
+    return false;
+  }
+}
+
 bool ARMBaseInstrInfo::isSwiftFastImmShift(const MachineInstr *MI) const {
   if (MI->getNumOperands() < 4)
     return true;
index a02c66ee9e26533151feed2cfcfe38930d0b1b94..2e0f1f8af91382d3c8ac6a64ce6bfee0a4549405 100644 (file)
@@ -104,6 +104,8 @@ public:
     getNoopForMachoTarget(NopInst);
   }
 
+  bool isTailCall(const MachineInstr &Inst) const override;
+
   // Return the non-pre/post incrementing version of 'Opc'. Return 0
   // if there is not such an opcode.
   virtual unsigned getUnindexedOpcode(unsigned Opc) const =0;