[RISCV] Add a test showing incorrect codegen
This patch adds a test which shows how the compiler incorrectly sets the size and alignment of a stack object used to indirectly pass vector types to functions. In the particular example, the test passes a <4 x i8> vector type to a function and creates a stack object of size and alignment equal to 4 bytes. However, the code generated to set up that parameter has been scalarized and stores each element as individual XLEN-sized values. Thus on RV32 this stores 16 bytes and on RV64 32 bytes, both of which clobber the stack. Similarly, the alignment is set up as the alignment of the vector type, which is not necessarily the natural alignment of XLEN. Reviewed By: luismarques Differential Revision: https://reviews.llvm.org/D95025
Loading
Please register or sign in to comment