Generate pre- and post-indexed forms of ST*G and STGP when possible.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
- Build Status
Buildable 38304 Build 38303: arc lint + arc unit
Event Timeline
llvm/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp | ||
---|---|---|
211 | STZG and STZ2G store zero to the memory contents, so don't belong in this list according to the comment above. After reading the rest of the patch, I think it's the comment that's wrong, these instructions are allowed to write regular memory, but not with contents which depend on the address part of the input register. | |
llvm/test/CodeGen/AArch64/ldst-opt-mte.mir | ||
5 | We should also test a mis-aligned offset (e.g. $x0 = ADDXri $x0, 8, 0) as well as the edges of the range. |
Added merging of STGP with the same source and address register.
Added more tests.
Fixed a comment.
I've noticed that the spec does not say that STGP with the same source and address register is unpredictable, and instead defines it to update the writeback register after the source register is read. This lets us merge STGP forward, but not backward. Implemented with tests.
llvm/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp | ||
---|---|---|
211 | Good point! Reworded the comment. | |
llvm/test/CodeGen/AArch64/ldst-opt-mte.mir | ||
5 | Added a test for mis-aligned offset. What do you mean by the edges of the range? There are tests for extreme values of the offset in ADDXri, see test_STG_post2 .. test_STG_post5 below and the same for STGP. |
LGTM
llvm/test/CodeGen/AArch64/ldst-opt-mte.mir | ||
---|---|---|
5 | I meant the extreme values which you already have tests for. |
STZG and STZ2G store zero to the memory contents, so don't belong in this list according to the comment above. After reading the rest of the patch, I think it's the comment that's wrong, these instructions are allowed to write regular memory, but not with contents which depend on the address part of the input register.