Teach LowerToPredicatedOp to lower fixed length vector operations.
Add AArch64ISD nodes and isel patterns for predicated integer
and floating point adds.
Together this enables SVE code generation for fixed length vector adds.
Paths
| Differential D82483
[SVE] Code generation for fixed length vector adds. ClosedPublic Authored by paulwalker-arm on Jun 24 2020, 10:27 AM.
Details Summary Teach LowerToPredicatedOp to lower fixed length vector operations. Add AArch64ISD nodes and isel patterns for predicated integer Together this enables SVE code generation for fixed length vector adds.
Diff Detail
Event TimelineComment Actions I've deviated from the base fixed length support to create this patch that adds the base work that's likely common to many of the arithmetic and logical operations. I went with refactoring LowerToPredicatedOp as it's likely to be used in all the same places as those required for fixed length types. I've probably gone overboard with the tests but I figure doing so for just the adds gives us enough coverage so that people adding support for similar operations only require minimal tests. Perhaps this matches what I've done for element types like double or perhaps we can just add tests for a single vector length (e.g. 512bit). NOTE: Patch requires D82466 for sve-fixed-length-int-arith.ll to pass.
Comment Actions
There's a comment higher up where I mention this patch requires D82466, which adds some missing MVT. Comment Actions Hi @paulwalker-arm, ok fair enough. It was just because you said "sve-fixed-length-int-arith.ll" fails due to missing D82466, but there are 4 tests failing. Just making sure these are all due to D82466 that's all. :) Comment Actions Thanks Dave, turns out changing FADD to custom lowering is breaking the cost model test. I've added an entry to restore the original cost because lowering to SVE should not add additional cost beyond requiring a predicate, which is likely to be spread across many instructions. This should be extended to more ISD nodes, hence me using plurals within the comment, but currently we only test FADD so I'm keeping my change minimal. paulwalker-arm added a parent revision: D82466: [MVT] Add missing floating point types for 1024/2048-bit vectors..Jun 25 2020, 9:45 AM
paulwalker-arm added inline comments.
Comment Actions LGTM
This revision is now accepted and ready to land.Jun 26 2020, 8:50 AM
paulwalker-arm added inline comments.
Closed by commit rG3a98d5d7e7f5: [SVE] Code generation for fixed length vector adds. (authored by paulwalker-arm). · Explain WhyJun 26 2020, 1:09 PM This revision was automatically updated to reflect the committed changes. paulwalker-arm marked an inline comment as done.
Revision Contents
Diff 273417 llvm/lib/Target/AArch64/AArch64ISelLowering.h
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td
llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
llvm/lib/Target/AArch64/SVEInstrFormats.td
llvm/test/CodeGen/AArch64/sve-fixed-length-fp-arith.ll
llvm/test/CodeGen/AArch64/sve-fixed-length-int-arith.ll
|
clang-format not found in user's PATH; not linting file.