[AArch64][SVE][InstCombine] Move last{a,b} before binop if one operand is a splat...
authorUsman Nadeem <mnadeem@quicinc.com>
Wed, 28 Jul 2021 04:02:32 +0000 (21:02 -0700)
committerUsman Nadeem <mnadeem@quicinc.com>
Mon, 9 Aug 2021 21:48:41 +0000 (14:48 -0700)
commit85bbc05154ba400b99045ade2864526a887e81aa
tree30426d2b7a1ca20bfdd0251bf00c4390aabab9e3
parent614c7d03877fd99c2de47429b15be3f00306a3bd
[AArch64][SVE][InstCombine] Move last{a,b} before binop if one operand is a splat value

Move the last{a,b} operation to the vector operand of the binary instruction if
the binop's operand is a splat value. This essentially converts the binop
to a scalar operation.

Example:
    // If x and/or y is a splat value:
    lastX (binop (x, y)) --> binop(lastX(x), lastX(y))

Differential Revision: https://reviews.llvm.org/D106932

Change-Id: I93ff5302f9a7972405ee0d3854cf115f072e99c0
llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
llvm/test/Transforms/InstCombine/AArch64/sve-intrinsic-opts-lasta-lastb.ll