[all-commits] [llvm/llvm-project] a1e036: Fix limit behavior of dynamic alloca

Tom Stellard via All-commits all-commits at lists.llvm.org
Tue Nov 24 18:58:48 PST 2020


  Branch: refs/heads/release/11.x
  Home:   https://github.com/llvm/llvm-project
  Commit: a1e0363c7402f7aa58e24e0e6dfa447ebabc1910
      https://github.com/llvm/llvm-project/commit/a1e0363c7402f7aa58e24e0e6dfa447ebabc1910
  Author: serge-sans-paille <sguelton at redhat.com>
  Date:   2020-11-24 (Tue, 24 Nov 2020)

  Changed paths:
    M llvm/lib/Target/X86/X86ISelLowering.cpp
    M llvm/test/CodeGen/X86/stack-clash-dynamic-alloca.ll

  Log Message:
  -----------
  Fix limit behavior of dynamic alloca

When the allocation size is 0, we shouldn't probe. Within [1,  PAGE_SIZE], we
should probe once etc.

This fixes https://bugs.llvm.org/show_bug.cgi?id=47657

Differential Revision: https://reviews.llvm.org/D88548

(cherry picked from commit 9573c9f2a363da71b2c07a3add4e52721e6028a0)


  Commit: aac36687f7978f33751daf2870b5c812124ebfaf
      https://github.com/llvm/llvm-project/commit/aac36687f7978f33751daf2870b5c812124ebfaf
  Author: serge-sans-paille <sguelton at redhat.com>
  Date:   2020-11-24 (Tue, 24 Nov 2020)

  Changed paths:
    M llvm/lib/Target/X86/X86FrameLowering.cpp
    M llvm/lib/Target/X86/X86FrameLowering.h
    A llvm/test/CodeGen/X86/stack-clash-large-large-align.ll
    R llvm/test/CodeGen/X86/stack-clash-no-free-probe.ll
    A llvm/test/CodeGen/X86/stack-clash-small-alloc-medium-align.ll
    A llvm/test/CodeGen/X86/stack-clash-small-large-align.ll

  Log Message:
  -----------
  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

(cherry picked from commit f2c6bfa350de142e4d63808d03335f69bd136d6a)


  Commit: bbe6cbbed8c7460a7e8477373b9250543362e771
      https://github.com/llvm/llvm-project/commit/bbe6cbbed8c7460a7e8477373b9250543362e771
  Author: serge-sans-paille <sguelton at redhat.com>
  Date:   2020-11-24 (Tue, 24 Nov 2020)

  Changed paths:
    M llvm/lib/Target/X86/X86ISelLowering.cpp
    M llvm/test/CodeGen/X86/stack-clash-dynamic-alloca.ll
    M llvm/test/CodeGen/X86/stack-clash-small-alloc-medium-align.ll

  Log Message:
  -----------
  [stack-clash] Fix probing of dynamic alloca

- Perform the probing in the correct direction.
  Related to https://github.com/rust-lang/rust/pull/77885#issuecomment-711062924

- The first touch on a dynamic alloca cannot use a mov because it clobbers
  existing space. Use a xor 0 instead

Differential Revision: https://reviews.llvm.org/D90216

(cherry picked from commit 0f60bcc36c34522618bd1425a45f8c6006568fb6)


Compare: https://github.com/llvm/llvm-project/compare/3e8d9807d663...bbe6cbbed8c7


More information about the All-commits mailing list