Added register + immediate and register + register addressing modes for the following intrinsics:
- Masked load and stores:
- Sign and zero extended load and truncated stores.
- No extension or truncation.
- Masked non-temporal load and store.
Paths
| Differential D74254
[llvm][aarch64] SVE addressing modes. ClosedPublic Authored by fpetrogalli on Feb 7 2020, 1:35 PM.
Details
Summary Added register + immediate and register + register addressing modes for the following intrinsics:
Diff Detail
Event TimelineHerald added subscribers: llvm-commits, hiraditya, kristof.beyls, tschuett. · View Herald Transcript fpetrogalli retitled this revision from [WIP][llvm][aarch64] SVE addressing modes: register + immediate. to [llvm][aarch64] SVE addressing modes.. Comment ActionsThe patch now covers all the LLVM intrinsic listed in the summary:
Comment Actions Hi @fpetrogalli, thank you for working on this.
Comment Actions @andwar , thank you for the review. I'll update the patch asap.
I see your point, but the tests that use merge and store at the same time are using exactly the same addressing modes, it is not that they are using something different. So if something fails in the addressing mode of the load, it fails in the addressing mode of the store. Having them merged together saves quite some typing, and has no disadvantages in term of unit testing.
Fair point, I'll remove the plus.
Very good point. The type redefinition saved me a lot of typing, but now that the tests are there it is better o remove it.
They are necessary for the reg+imm tests. They are needed to make sure that the ADD node of the base address is always in the format (ADD %BASE (VSCALE CONST)). I'll see if I can add some unit tests specifically for the combiner changes.
fpetrogalli added inline comments. fpetrogalli added a parent revision: D73602: [SVE] Add support for lowering GEPs involving scalable vectors..Feb 12 2020, 1:33 PM fpetrogalli marked 2 inline comments as done. Comment ActionsAddress code review from @andwar. I have added the tests for the DAG Combine changes. Comment Actions I have uploaded PDF renderings of the DAGS before and after the changes. I am not sure the tests for the combiner are explicit about the fact that the combiner is run on this pattern, but the graphs attached here show the effect of my changes on the code. I think that some of the patterns that are needed to show the changes in the output code are missing. before.dag.combine_sub_vscale_i64-bdd206.dot.pdf22 KBDownload
after.dag.combine_sub_vscale_i64-7f807e.dot.pdf22 KBDownload
before.dag.combine_mul_vscale_i64-f4259d.dot.pdf21 KBDownload
before.dag.combine_add_vscale_i64-62fd59.dot.pdf20 KBDownload
after.dag.combine_mul_vscale_i64-975c2a.dot.pdf20 KBDownload
after.dag.combine_add_vscale_i64-35445c.dot.pdf20 KBDownload Comment Actions
Ah, I've realised that you split the files per addressing modes. As the name of the patch would suggest :-) OK, keep it as it is. Thank you for adding DAG diagrams - they are very helpful!
fpetrogalli added inline comments.
fpetrogalli marked 13 inline comments as done. Comment ActionsThank you @adwar. I have addressed your comments. Your awk script was very useful.
Comment Actions Thanks for creating this patch @fpetrogalli!
fpetrogalli added a parent revision: D74782: [llvm][CodeGen] DAG Combiner folds for vscale..Feb 18 2020, 11:34 AM fpetrogalli marked 8 inline comments as done. Comment ActionsI have extracted the DAGCombiner changes in a separate patch as fpetrogalli added inline comments.
Comment Actions LGTM!
This revision is now accepted and ready to land.Feb 21 2020, 9:58 AM fpetrogalli added inline comments.
fpetrogalli added inline comments.
Closed by commit rGe2ed1d14d6c2: [llvm][aarch64] SVE addressing modes. (authored by fpetrogalli). · Explain WhyFeb 21 2020, 12:04 PM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 245224 llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp
llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td
llvm/lib/Target/AArch64/SVEInstrFormats.td
llvm/test/CodeGen/AArch64/sve-gep.ll
llvm/test/CodeGen/AArch64/sve-pred-contiguous-ldst-addressing-mode-reg-imm.ll
llvm/test/CodeGen/AArch64/sve-pred-contiguous-ldst-addressing-mode-reg-reg.ll
llvm/test/CodeGen/AArch64/sve-pred-non-temporal-ldst-addressing-mode-reg-imm.ll
llvm/test/CodeGen/AArch64/sve-pred-non-temporal-ldst-addressing-mode-reg-reg.ll
|
nit: This one is missing a comment.