Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[RISCV] Avoid scalar outgoing argumetns overwriting vector frame obje…
…cts. When using FP to access stack objects, the scalable stack objects will be put at the lower end of the frame. It looks like ``` |-------------------| <-- FP | callee-saved regs | |-------------------| | scalar local vars | |-------------------| | RVV local vars | |-------------------| <-- SP ``` If there are scalar arguments that need to pass through memory and there are vector objects on the stack using FP to access. The outgoing scalar arguments will overwrite the vector objects. It looks like ``` |-------------------| <-- FP | callee-saved regs | |-------------------| | scalar local vars | |-------------------| |-------------------| | RVV local vars | | outgoing args | <- outgoing arguments |-------------------| <-- SP |-------------------| overwrite from here. ``` In this patch, we reserve the stack for the outgoing arguments before function calls if using FP to access and there are scalable vector frame objects. It looks like ``` |-------------------| <-- FP | callee-saved regs | |-------------------| | scalar local vars | |-------------------| | RVV local vars | |-------------------| | outgoing args | |-------------------| <-- SP ``` Differential Revision: https://reviews.llvm.org/D103622
- Loading branch information