HomePhabricator

[RISCV] Scale scalably-typed split argument offsets by VSCALE

Authored by frasercrmck on May 27 2021, 8:47 AM.

Description

[RISCV] Scale scalably-typed split argument offsets by VSCALE

This patch fixes a bug in lowering scalable-vector types in RISC-V's
main calling convention. When scalable-vector types are split and passed
indirectly, the target is responsible for scaling the offset --
initially set to the known-minimum store size -- by the scalable factor.

Before this we were issuing overlapping loads or stores to the different
parts, leading to incorrect codegen.

Credit to @HsiangKai for spotting this.

Reviewed By: HsiangKai

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