[all-commits] [llvm/llvm-project] 1ac980: [X86] Generate unaligned access for fixed slots in...

Matheus Izvekov via All-commits all-commits at lists.llvm.org
Thu Feb 4 19:37:20 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1ac98044dfc250a0454762eb49f138b1f3f035e7
      https://github.com/llvm/llvm-project/commit/1ac98044dfc250a0454762eb49f138b1f3f035e7
  Author: Matheus Izvekov <mizvekov at gmail.com>
  Date:   2021-02-05 (Fri, 05 Feb 2021)

  Changed paths:
    M llvm/lib/Target/X86/X86InstrInfo.cpp
    M llvm/test/CodeGen/X86/anyregcc.ll
    M llvm/test/CodeGen/X86/avx-intel-ocl.ll
    M llvm/test/CodeGen/X86/avx512-intel-ocl.ll
    A llvm/test/CodeGen/X86/x86-64-xmm-spill-unaligned.ll

  Log Message:
  -----------
  [X86] Generate unaligned access for fixed slots in unaligned stack

loadRegFromStackSlot()/storeRegToStackSlot() can generate aligned access
instructions for stack slots even if the stack is unaligned, based on the
assumption that the stack can be realigned.
However, this doesn't work for fixed slots, which are e.g. used for
spilling XMM registers in a non-leaf function with
`__attribute__((preserve_all))`.
When compiling such code with `-mstack-alignment=8`, this causes general
protection faults.

Fix it by only considering stack realignment for non-fixed slots.

Note that this changes the output of three existing tests which spill AVX
registers, since AVX requires higher alignment than the ABI provides on
stack frame entry.

Reviewed By: rnk, jyknight

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




More information about the All-commits mailing list