This patch adds tests for folds of ADDIs into load/stores, focusing on load/stores with nonzero offsets.
When the offset is nonzero we currently don't do the fold. A follow-up patch will improve on that.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
One nit, beyond that happy for this to land. Don't forget [NFC] in the title.
llvm/test/CodeGen/RISCV/fold-addi-loadstore.ll | ||
---|---|---|
135 | I realise the code is the same, but it would be good to have tests for store to g_0, g_1, g_2 as well. |
llvm/test/CodeGen/RISCV/fold-addi-loadstore.ll | ||
---|---|---|
135 | I tried to strike a balance between good coverage of the conceptual issue and too much repetition. It seemed like it was enough for one of the test types (loads) to thoroughly test all of the relevant offsets, while the other test types (stores, etc.) could focus on the boundary conditions, with one test where the fold shouldn't happen and one where it should. But I can include all of the combinations if you think that's beneficial for the patch. |
Nice work, let's get this landed!
llvm/test/CodeGen/RISCV/fold-addi-loadstore.ll | ||
---|---|---|
135 | Sounds reasonable to me! |
I realise the code is the same, but it would be good to have tests for store to g_0, g_1, g_2 as well.