As frame pointer elimination isn't implemented until a later patch and we make extensive use of update_llc_test_checks.py, this changes touches a lot of the RISC-V tests.
Details
Diff Detail
Event Timeline
Address @mgrang's review comments (thanks!). I also moved the changes to eliminateFrameIndex to the previous patch, as it makes sense to just do it right from the start.
lib/Target/RISCV/RISCVFrameLowering.cpp | ||
---|---|---|
90 | How should we handle cases where we need a bigger stack? |
lib/Target/RISCV/RISCVFrameLowering.cpp | ||
---|---|---|
90 |
Refreshing the patch. Just awaiting the dependent frameindex patch to be reviewed in order to merge.
small drive by comments.
lib/Target/RISCV/RISCVFrameLowering.cpp | ||
---|---|---|
130 | You've got these in a couple of places, time for an alias in the enum? | |
test/CodeGen/RISCV/addc-adde-sube-subc.ll | ||
10 | The test churn in this patch is really unfortunate. Is there a small change you can add to not need all the spill code for most functions? |
Rebase and use an adjustReg helper (this minimises the diff for D40807).
lib/Target/RISCV/RISCVFrameLowering.cpp | ||
---|---|---|
130 | I've added some helper functions to return FPReg and SPReg. They take RISCVSubtargetInfo to allow future extensibility (e.g. different ABIs). | |
test/CodeGen/RISCV/addc-adde-sube-subc.ll | ||
10 | Frame pointer elimination isn't a particularly large change (see here). Although verbose generated code has disadvantages, I think there are benefits to "completing" codegen before supporting extra optimisations, even fairly trivial ones. Although ultimately a straight-forward change, a large percentage of the bugs I've encountered while developing the backend have actually been related to frame handling (whether as part of argument passing or otherwise). |
shouldn't this be uint64_t?
(also not sure about MaxCallFrameSize below, as alignTo() returns uint64_t. It gets two unsigned ints, so I'll leave that up to you if it's necessary to change just to satisfy linters)