[PATCH] D84419: Fix interaction between stack alignment and inline-asm stack clash protection

serge via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 24 05:00:40 PDT 2020


serge-sans-paille marked an inline comment as done.
serge-sans-paille added inline comments.


================
Comment at: llvm/lib/Target/X86/X86FrameLowering.cpp:672
 
+  if (Align) {
+    const unsigned ADDOpc = getADDriOpcode(Uses64BitFramePtr, Align);
----------------
lkail wrote:
> When `Align > StackProbeSize`, which should be rare, is there any chance that the first probe is performed on the old frame?
That's a concern I have. In that particular code that's ok, because we check `Align <= StackProbeSize` and we just adjust the first probe. In the other case what we're basically doing is

```
rsp += rem(rsp, align)
rsp -= align
rsp += StackProbeSize
*rsp = 0
```

if rsp is already aligned, we end-up doing `align/StackProbeSize` useless probing


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D84419/new/

https://reviews.llvm.org/D84419





More information about the llvm-commits mailing list