[PATCH] D19904: XRay: Add entry and exit sleds

Dean Michael Berris via llvm-commits llvm-commits at lists.llvm.org
Tue May 10 21:08:53 PDT 2016


dberris added inline comments.

================
Comment at: include/llvm/Target/TargetInstrInfo.h:155-166
@@ -154,1 +154,14 @@
 
+  /// This returns true if the given instruction is a "normal return" as opposed
+  /// to special kinds of returns. On platforms where there may be multiple
+  /// OpCodes that signify 'normal' return instructions (like in X86), this
+  /// return true for those instructions. The default implementation excludes
+  /// known non-normal instructions.
+  virtual bool isNormalReturn(const MachineInstr *MI) const {
+    if (!MI->isReturn()) return false;
+    auto OpCode = MI->getOpcode();
+    bool IsCatchReturn = OpCode == getCatchReturnOpcode();
+    bool IsFrameDestroy = OpCode == getCallFrameDestroyOpcode();
+    return !IsCatchReturn && !IsFrameDestroy;
+  }
+
----------------
majnemer wrote:
> The same way it is handled for `X86::ADJCALLSTACKDOWN64` vs `X86::ADJCALLSTACKDOWN32`:
> https://github.com/llvm-mirror/llvm/blob/master/lib/Target/X86/X86InstrInfo.cpp#L105
That makes a lot of sense, thanks! I'll rework this a bit to make it more of a targeted specific OpCode.

I suppose it's fine to have multiples of these functions, each for relevant flavours of fairly common instruction classes, yes? So I suppose, for `tail call` exits/returns, we would have something similar for that?


http://reviews.llvm.org/D19904





More information about the llvm-commits mailing list