[PATCH] D94230: [AArch64][SVE] Add SVE IR pass to coalesce ptrue instrinsic calls

Joe Ellis via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 7 04:49:40 PST 2021


joechrisellis created this revision.
joechrisellis added reviewers: peterwaller-arm, bsmith.
Herald added subscribers: NickHung, psnobl, hiraditya, kristof.beyls, tschuett, mgorny.
Herald added a reviewer: efriedma.
joechrisellis requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

It is possible to eliminate redundant calls to the SVE ptrue intrinsic.
For example: suppose that we have two SVE ptrue intrinsic calls P1 <https://reviews.llvm.org/P1> and
P2 <https://reviews.llvm.org/P2>. If P1 <https://reviews.llvm.org/P1> is at least as wide as P2 <https://reviews.llvm.org/P2>, then P2 <https://reviews.llvm.org/P2> can be written as a
reinterpret P1 <https://reviews.llvm.org/P1> using the SVE reinterpret intrinsics.

Coalescing ptrues can result in fewer ptrue instructions in the codegen,
and is conducive to better analysis further down the line.

This commit introduces a new pass, aarch64-sve-coalesce-ptrues, which
removes redundant ptrue intrinsic calls, replacing them with
reinterprets of existing 'wider' ptrue intrinsic calls where possible.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D94230

Files:
  llvm/lib/Target/AArch64/AArch64.h
  llvm/lib/Target/AArch64/AArch64TargetMachine.cpp
  llvm/lib/Target/AArch64/CMakeLists.txt
  llvm/lib/Target/AArch64/SVECoalescePTrues.cpp
  llvm/test/CodeGen/AArch64/sve-coalesce-ptrues.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D94230.315104.patch
Type: text/x-patch
Size: 14533 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210107/71a7d1ce/attachment.bin>


More information about the llvm-commits mailing list