aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorFraser Cormack <fraser@codeplay.com>2021-03-23 12:28:35 +0000
committerFraser Cormack <fraser@codeplay.com>2021-03-25 10:35:31 +0000
commit321a71a77268c314c769a98d62c14609aff306e0 (patch)
tree2e1b37389f5888c1f4c775855ba1710e7e7956b2 /clang/lib/Frontend/CompilerInvocation.cpp
parent36e3c6c841eb7afa417fea4f3357c48cd1bf0583 (diff)
downloadllvm-321a71a77268c314c769a98d62c14609aff306e0.zip
llvm-321a71a77268c314c769a98d62c14609aff306e0.tar.gz
llvm-321a71a77268c314c769a98d62c14609aff306e0.tar.bz2
[RISCV] Optimize BUILD_VECTOR sequences that reveal hidden splats
This patch adds further optimization techniques to RVV BUILD_VECTOR lowering. It teaches the compiler to find splats of larger vector element types "hidden" in smaller ones. For example, a v4i8 build_vector (0x1, 0x2, 0x1, 0x2) could be splat as v2i16 0x0201. This is generally more optimal than the dominant-element BUILD_VECTORs and so takes priority. This optimization is currently limited to all-constant-or-undef BUILD_VECTORs as those were found to be the most common. There's no reason this couldn't be extended to other BUILD_VECTORs, but the additional bit-manipulation instructions may require more sophisticated heuristics. There are some cases where the materialization of the larger constant takes more scalar instructions than it does to build the vector with vector instructions. We could add heuristics to try and catch this. Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D99195
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions