diff options
author | Fraser Cormack <fraser@codeplay.com> | 2024-12-17 10:22:19 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-17 10:22:19 +0000 |
commit | a1f5fe8c851ba6a0070e4cab9e7436e962677ac6 (patch) | |
tree | 52305efbc32493f8f09275d47fd16f1434896516 /clang/lib/CodeGen/CodeGenFunction.cpp | |
parent | 7c135e17fbb7178466eafce9826c896518907637 (diff) | |
download | llvm-a1f5fe8c851ba6a0070e4cab9e7436e962677ac6.zip llvm-a1f5fe8c851ba6a0070e4cab9e7436e962677ac6.tar.gz llvm-a1f5fe8c851ba6a0070e4cab9e7436e962677ac6.tar.bz2 |
[NVPTX] Optimize v2x16 BUILD_VECTORs to PRMT (#116675)
When two 16-bit values are combined into a v2x16 vector, and those
values are truncated come from 32-bit values, a PRMT instruction can
save registers by selecting bytes directly from the original 32-bit
values. We do this during a post-legalize DAG combine, as these
opportunities are typically only exposed after the BUILD_VECTOR's
operands have been legalized.
Additionally, if the 32-bit values are right-shifted, we can fold in the
shift by selecting higher bytes with PRMT. Only logical right-shifts by
16 are supported (for now) since those are the only situations seen in
practice. Right shifts by 16 often come up during the legalization of
EXTRACT_VECTOR_ELT.
This idea was brought up in a PR comment by @Artem-B.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
0 files changed, 0 insertions, 0 deletions