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

Dean Michael Berris via llvm-commits llvm-commits at lists.llvm.org
Thu May 5 22:15:35 PDT 2016


dberris added inline comments.

================
Comment at: lib/CodeGen/XRayInstrumentation.cpp:72-77
@@ +71,8 @@
+      // FIXME: Handle tail calls here too?
+      if (Terminator.isReturn()) {
+        // Replace return instructions with:
+        //   PATCHABLE_RET <Opcode>, <Operand>...
+        auto MIB = BuildMI(MBB, Terminator, Terminator.getDebugLoc(),
+                           TII->get(TargetOpcode::PATCHABLE_RET))
+                       .addImm(Terminator.getOpcode());
+        for (auto &MO : Terminator.operands()) {
----------------
majnemer wrote:
> I don't think you want to replace whacky constructs like `EH_RETURN` and `CLEANUPRET` with `PATCHABLE_RET`, do you?  Just "normal" returns, right?
Yes, that's right -- does this version exclude those appropriately?

================
Comment at: lib/CodeGen/XRayInstrumentation.cpp:80
@@ +79,3 @@
+          if (MO.isReg())
+            MIB.addReg(MO.getReg(), RegState::Implicit);
+        }
----------------
sanjoy wrote:
> Why do you care only about register operands here?
Oops, I had assumed that the RET instructions only ever had register operands. That's a faulty assumption, good catch.


http://reviews.llvm.org/D19904





More information about the llvm-commits mailing list