This is an archive of the discontinued LLVM Phabricator instance.

[RISCV][NFC] Add tests for folds of ADDIs into load/stores
ClosedPublic

Authored by luismarques on May 10 2020, 11:10 AM.

Details

Summary

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.

Diff Detail

Event Timeline

luismarques created this revision.May 10 2020, 11:10 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 10 2020, 11:10 AM

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.

luismarques retitled this revision from [RISCV] Add tests for folds of ADDIs into load/stores to [RISCV][NFC] Add tests for folds of ADDIs into load/stores.May 11 2020, 1:12 PM
luismarques marked an inline comment as done.
luismarques added inline comments.
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.

lenary accepted this revision.Jun 23 2020, 1:17 PM

Nice work, let's get this landed!

llvm/test/CodeGen/RISCV/fold-addi-loadstore.ll
135

Sounds reasonable to me!

This revision is now accepted and ready to land.Jun 23 2020, 1:17 PM
This revision was automatically updated to reflect the committed changes.