[AArch64][SVE][InstCombine] Replace last{a,b} intrinsics with extracts...
authorJoe Ellis <joe.ellis@arm.com>
Fri, 16 Apr 2021 10:05:05 +0000 (10:05 +0000)
committerJoe Ellis <joe.ellis@arm.com>
Tue, 20 Apr 2021 10:01:33 +0000 (10:01 +0000)
commitc91cd4f3bb53f6f3b2cbfd6269ebb88eef410246
tree6504661c06e67acc0c1c5211dc125d2aea92b425
parent90248f2daa05f73cc5d2ca971c187d6d292c63a0
[AArch64][SVE][InstCombine] Replace last{a,b} intrinsics with extracts...

when the predicate used by last{a,b} specifies a known vector length.

For example:
  aarch64_sve_lasta(VL1, D) -> extractelement(D, #1)
  aarch64_sve_lastb(VL1, D) -> extractelement(D, #0)

Co-authored-by: Paul Walker <paul.walker@arm.com>
Differential Revision: https://reviews.llvm.org/D100476
llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h
llvm/test/Transforms/InstCombine/AArch64/sve-intrinsic-opts-lasta-lastb.ll [new file with mode: 0644]