HomePhabricator

change rvv frame layout

Authored by StephenFan on Feb 19 2021, 10:02 PM.

Description

change rvv frame layout

This patch change the rvv frame layout that proposed in D94465. In patch D94465, In the eliminateFrameIndex function,
to eliminate the rvv frame index, create temp virtual register is needed. This virtual register should be scavenged by class
RegsiterScavenger. If the machine function has other unused registers, there is no problem. But if there isn't unused registers,
we need a emergency spill slot. Because of the emergency spill slot belongs to the scalar local variables field, to access emergency
spill slot, we need a temp virtual register again. This makes the compiler report the "Incomplete scavenging after 2nd pass" error.
So I change the rvv frame layout as follows:

|--------------------------------------|
|   arguments passed on the stack      |
|--------------------------------------|<--- fp
|   callee saved registers             |
|--------------------------------------|
|   rvv vector objects(local variables |
|   and outgoing arguments             |
|--------------------------------------|
|   realignment field                  |
|--------------------------------------|
|   scalar local variable(also contains|
|   emergency spill slot)              |
|--------------------------------------|<--- bp
|   variable-sized local variables     |
|--------------------------------------|<--- sp

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

Details

Committed
StephenFanMar 13 2021, 12:05 AM
Differential Revision
D97111: [RISCV] change rvv frame layout
Parents
rG5ddbd1fdbb08: [RISCV] Remove redundancy -mattr=+d in test file
Branches
Unknown
Tags
Unknown