[AArch64][SVE] Coalesce ptrue instrinsic calls where possible
authorJoe Ellis <joe.ellis@arm.com>
Fri, 5 Feb 2021 10:43:06 +0000 (10:43 +0000)
committerJoe Ellis <joe.ellis@arm.com>
Fri, 5 Feb 2021 10:43:28 +0000 (10:43 +0000)
commit3d257fde75f84fe2e3c016ee0f6e67755bdd8b8b
treef918e8d434ce925edfee8bfa90c3d4bed5e3b0f4
parent91698fe45f6068c5a6f8284e5e8e19a8d89dfea8
[AArch64][SVE] Coalesce ptrue instrinsic calls where possible

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

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

This commit extends the aarch64-sve-intrinsic-opts pass to support
coalescing ptrue intrisic calls.

Reviewed By: david-arm

Differential Revision: https://reviews.llvm.org/D94230
llvm/lib/Target/AArch64/SVEIntrinsicOpts.cpp
llvm/test/CodeGen/AArch64/sve-coalesce-ptrue-intrinsics.ll [new file with mode: 0644]