[PATCH] D13361: Support for emitting inline stack probes

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 6 13:16:31 PDT 2015


rnk added a comment.

In http://reviews.llvm.org/D13361#260983, @AndyAyers wrote:

> Using a pseduo for the prolog case sounds like a good suggestion.
>
> I'd like to preserve the ability to generate the in-body expansions early, before register allocation, and share the expansion code between the two cases like is done now. \\
>
> If I go this route, where should the expansion code live?


I guess keeping it in X86FrameLowering would be fine. Seems better than dumping it into the 27K line X86ISelLowering. =/


================
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 {
----------------
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.


Repository:
  rL LLVM

http://reviews.llvm.org/D13361





More information about the llvm-commits mailing list