[RISCV] Ensure the entire stack is aligned to the RVV stack alignment
authorFraser Cormack <fraser@codeplay.com>
Thu, 19 May 2022 13:47:40 +0000 (14:47 +0100)
committerFraser Cormack <fraser@codeplay.com>
Tue, 24 May 2022 05:58:51 +0000 (06:58 +0100)
commit08c9fb8447108fd436bd342a573181c624485608
tree65895b6d291ceadc42f12630aad67039b15ee771
parentcb8681a2b3ad406f1215a17fd32989211c561e3e
[RISCV] Ensure the entire stack is aligned to the RVV stack alignment

This patch fixes another bug in the RVV frame lowering. While some frame
objects with non-default stack IDs (such scalable-vector alloca
instructions) are considered in the target-independent max alignment
calculations, others (for example, during calling-convention lowering)
are not. This means we'd occasionally align the base of the stack to
only 16 bytes, with no way to ensure that the RVV section contained
within that is aligned to anything higher.

Reviewed By: StephenFan

Differential Revision: https://reviews.llvm.org/D125973
llvm/lib/Target/RISCV/RISCVFrameLowering.cpp
llvm/test/CodeGen/RISCV/rvv/calling-conv-fastcc.ll
llvm/test/CodeGen/RISCV/rvv/calling-conv.ll
llvm/test/CodeGen/RISCV/rvv/fixed-vectors-emergency-slot.mir
llvm/test/CodeGen/RISCV/rvv/fixed-vectors-insert-subvector.ll
llvm/test/CodeGen/RISCV/rvv/no-reserved-frame.ll
llvm/test/CodeGen/RISCV/rvv/rvv-args-by-mem.ll