diff options
author | Fraser Cormack <fraser@codeplay.com> | 2021-03-15 15:52:16 +0000 |
---|---|---|
committer | Fraser Cormack <fraser@codeplay.com> | 2021-03-17 10:09:04 +0000 |
commit | 70251759a29830a2c0aca146d91bbe65e0f1df0c (patch) | |
tree | 9d590c37f0ef699afe9ae10f9e1b4532515798e8 /clang/lib/Frontend/InitPreprocessor.cpp | |
parent | 967b64beb4bf953f452a2866716065e8bbcb5d2f (diff) | |
download | llvm-70251759a29830a2c0aca146d91bbe65e0f1df0c.zip llvm-70251759a29830a2c0aca146d91bbe65e0f1df0c.tar.gz llvm-70251759a29830a2c0aca146d91bbe65e0f1df0c.tar.bz2 |
[RISCV] Optimize "dominant element" BUILD_VECTORs
This patch adds an optimization path for BUILD_VECTOR nodes where the
majority of the elements are identical. These can be splatted, with the
remaining elements patched up with INSERT_VECTOR_ELTs. The threshold can
be tweaked as required - it is currently conservative. Undef elements
are disregarded when judging the dominance of a particular element. This
allows them to be covered by the splat value.
In addition, vectors of 2 elements are always optimized to a splat (for
the upper element) and an insert at element zero.
This optimization is disabled when optimizing for size.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D98700
Diffstat (limited to 'clang/lib/Frontend/InitPreprocessor.cpp')
0 files changed, 0 insertions, 0 deletions