[all-commits] [llvm/llvm-project] 7025ac: [X86] Don't elide argument copies for scalarized v...

Nikita Popov via All-commits all-commits at lists.llvm.org
Thu Jul 13 05:51:34 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7025ac81f05c90e0beee67755d81f5be7c508e52
      https://github.com/llvm/llvm-project/commit/7025ac81f05c90e0beee67755d81f5be7c508e52
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2023-07-13 (Thu, 13 Jul 2023)

  Changed paths:
    M llvm/lib/Target/X86/X86ISelLowering.cpp
    M llvm/test/CodeGen/X86/pr63475.ll

  Log Message:
  -----------
  [X86] Don't elide argument copies for scalarized vectors (PR63475)

When eliding argument copies, the memory layout between a plain
store of the type and the layout of the argument lowering on the
stack must match. For multi-part argument lowerings, this is not
necessarily the case.

The code already tried to prevent this optimization for "scalarized
and extended" vectors, but the check for "extends" was incomplete.
While a scalarized vector of i32s stores i32 values on the stack,
these are stored in 8 byte stack slots (on x86_64), so effectively
have padding.

Rather than trying to add more special cases to handle this (which
is not straightforward), I'm going in the other direction and
exclude scalarized vectors from this optimization entirely. This
seems like a rare case that is not worth the hassle -- the complete
lack of test coverage is not reassuring either.

Fixes https://github.com/llvm/llvm-project/issues/63475.

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




More information about the All-commits mailing list