[RISCV] Precommit test to show wrong way to pass scalable FP vector on stack
Test case to demo scaleable vector on stack will cause stack corruption.
Detail explan what happened:
```
tail call void @foo(i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0,
<vscale x 16 x float> zeroinitializer,
<vscale x 16 x float> zeroinitializer,
<vscale x 16 x float> zeroinitializer)
```
`foo` take 13 arguments, first 8 argument pass in GPR, and next 2 LMUL 8 vector
arguments passed in v8-v23, and now we run out of argument register for GPR and
vector register, so we must pass last LMUL 8 vector argument by stack.
However LLVM only reserve 8 byte on stack for the LMUL 8 vector
argument, it will cause stack corruption when we try to store that into
stack.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D145934
parent
67fde2b9
Please register or sign in to comment