[PATCH] D145301: Add more efficient vector bitcast for AArch64

Lawrence Benson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 4 01:45:48 PST 2023


lawben created this revision.
Herald added subscribers: hiraditya, kristof.beyls.
Herald added a project: All.
lawben requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Adds a custom DAG combine check for vector comparisons followed by a bitcast to a scalar value. Previously, this resulted in an expand. Now, this is done with a constant number of instructions that take one bit per vector value (via an AND mask) and perfom a horizontal add to get a single value. This is especially useful for Clang's __builtin_convertvector() to a bool vector.

Issue: https://github.com/llvm/llvm-project/issues/59829


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D145301

Files:
  llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
  llvm/test/CodeGen/AArch64/vec-combine-compare-to-bitmask.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D145301.502361.patch
Type: text/x-patch
Size: 8872 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230304/ed679b3f/attachment.bin>


More information about the llvm-commits mailing list