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

David Majnemer via llvm-commits llvm-commits at lists.llvm.org
Fri May 6 10:37:45 PDT 2016


majnemer added inline comments.

================
Comment at: lib/CodeGen/XRayInstrumentation.cpp:72-77
@@ -70,5 +71,8 @@
     for (auto &Terminator : MBB.terminators()) {
       // FIXME: Handle tail calls here too?
-      if (Terminator.isReturn()) {
+      if (Terminator.isReturn() &&
+          (Terminator.getOpcode() != ISD::CATCHRET ||
+           Terminator.getOpcode() != ISD::CLEANUPRET ||
+           Terminator.getOpcode() != ISD::EH_RETURN)) {
         // Replace return instructions with:
         //   PATCHABLE_RET <Opcode>, <Operand>...
----------------
I would recommend white-listing the opcodes you know are safe to replace instead of blacklisting the ones you know which are unsafe.
This would make the pass conservatively correct in the face of future changes to LLVM.


http://reviews.llvm.org/D19904





More information about the llvm-commits mailing list