Fix interaction between stack alignment and inline-asm stack clash protection
authorserge-sans-paille <sguelton@redhat.com>
Thu, 23 Jul 2020 14:22:48 +0000 (16:22 +0200)
committerserge-sans-paille <sguelton@redhat.com>
Fri, 2 Oct 2020 14:51:49 +0000 (16:51 +0200)
commitf2c6bfa350de142e4d63808d03335f69bd136d6a
tree569d42695bc8471e33fcc165a961315c5017efa6
parent7b19cd06d732e9c3db326dc9b9c82d66dc624fd2
Fix interaction between stack alignment and inline-asm stack clash protection

As reported in https://github.com/rust-lang/rust/issues/70143 alignment is not
taken into account when doing the probing. Fix that by adjusting the first probe
if the stack align is small, or by extending the dynamic probing if the
alignment is large.

Differential Revision: https://reviews.llvm.org/D84419
llvm/lib/Target/X86/X86FrameLowering.cpp
llvm/lib/Target/X86/X86FrameLowering.h
llvm/test/CodeGen/X86/stack-clash-large-large-align.ll [new file with mode: 0644]
llvm/test/CodeGen/X86/stack-clash-no-free-probe.ll [deleted file]
llvm/test/CodeGen/X86/stack-clash-small-alloc-medium-align.ll [new file with mode: 0644]
llvm/test/CodeGen/X86/stack-clash-small-large-align.ll [new file with mode: 0644]