[PATCH] D81221: [AArch64][GlobalISel] Move dup optimization into post-legalizer combiner
Jessica Paquette via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 4 21:28:46 PDT 2020
paquette created this revision.
paquette added a reviewer: aemerson.
Herald added subscribers: danielkiss, hiraditya, kristof.beyls, rovka.
Herald added a project: LLVM.
Since all of the other G_SHUFFLE_VECTOR transforms are going there, let's do this with dup as well. This is nice, because it lets us split up the original code into matching, register bank selection, and instruction selection.
- Create G_DUP, make it equivalent to AArch64dup
- Add a post-legalizer combine which is 90% a copy-and-paste from tryOptVectorDup, except with shuffle matching closer to what SelectionDAG does in `ShuffleVectorSDNode::isSplatMask`.
- Teach RegBankSelect about G_DUP. Since dup selection relies on the correct register bank for FP/GPR dup selection, this is necessary.
- Kill `tryOptVectorDup`, since it's now entirely handled bu G_DUP.
- Add testcases for the combine, RegBankSelect, and selection. The selection test gives the same selection results as the old test.
https://reviews.llvm.org/D81221
Files:
llvm/lib/Target/AArch64/AArch64Combine.td
llvm/lib/Target/AArch64/AArch64InstrGISel.td
llvm/lib/Target/AArch64/AArch64RegisterBankInfo.cpp
llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
llvm/lib/Target/AArch64/GISel/AArch64PostLegalizerCombiner.cpp
llvm/test/CodeGen/AArch64/GlobalISel/opt-shuffle-splat.mir
llvm/test/CodeGen/AArch64/GlobalISel/postlegalizer-combiner-shuffle-splat.mir
llvm/test/CodeGen/AArch64/GlobalISel/regbank-dup.mir
llvm/test/CodeGen/AArch64/GlobalISel/select-dup.mir
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D81221.268656.patch
Type: text/x-patch
Size: 32748 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200605/5be64e0b/attachment-0001.bin>
More information about the llvm-commits
mailing list