[PATCH] D13361: Support for emitting inline stack probes

Andy Ayers via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 6 14:50:27 PDT 2015


AndyAyers added a comment.

Let me rework this a bit and get back to you.


================
Comment at: lib/Target/X86/X86FrameLowering.cpp:552-555
@@ +551,6 @@
+
+  // If in the prolog, push RCX and RDX. If not, copy RAX to a virtual reg.
+  if (InProlog) {
+    BuildMI(&MBB, DL, TII.get(X86::PUSH64r)).addReg(X86::RCX);
+    BuildMI(&MBB, DL, TII.get(X86::PUSH64r)).addReg(X86::RDX);
+  } else {
----------------
rnk wrote:
> Are we sure we can have pushes without CFI to describe them in the prologue on Win64? If a user or profiler stops after this PUSH, they won't be able to unwind the stack. You could get away with homing RDX / RCX into the shadow space and then reloading afterwards.
> 
> Our existing use of `push %rax` in the prologue code is bad, but it shouldn't normally happen on Win64, since the standard calling convention doesn't pass data in via %rax.
Good catch -- the pushes/pops were just intended to be bring-up scaffolding.



Repository:
  rL LLVM

http://reviews.llvm.org/D13361





More information about the llvm-commits mailing list