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

Lawrence Benson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 10 11:42:19 PDT 2023


lawben updated this revision to Diff 512204.
lawben added a comment.

Changed approach as suggested by @dmgreen. We now use an explicit sign-extend and ignore the vector compare. The sign-extend is removed in later steps if there is a vector compare, 
so there is no overhead. This change allows us to determine the original type in more cases, as we can detect both `SETCC` and `TRUNC`.

Added a few more tests, also explicitly checking <64-bit vectors and <8-bit elements.

Just as an FYI for the tests: the sign-extend is implemented as a shift left by size-1 bits and a signed comparison <0, which is true if the MSB is set.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D145301/new/

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.512204.patch
Type: text/x-patch
Size: 20694 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230410/09028ddd/attachment.bin>


More information about the llvm-commits mailing list