[AArch64][SVE][CodeGen] Generate fused mul+add/sub ops with one of add/sub operands...
authorsgokhale <sgokhale@nvidia.com>
Wed, 5 Apr 2023 05:41:36 +0000 (11:11 +0530)
committersgokhale <sgokhale@nvidia.com>
Wed, 5 Apr 2023 05:41:36 +0000 (11:11 +0530)
commit99fc6ec34cc1b023a837830d266fbbd523a509c3
tree743d54f73c7148489e5a71040932c1e7667d1f97
parent17398b06fdf3206e314665c2d96cc176db2e2092
[AArch64][SVE][CodeGen] Generate fused mul+add/sub ops with one of add/sub operands as splat

Currently, depending upon whether the add/sub instruction can synthesize immediate directly,
its decided whether to generate mul+(add/sub immediate) or mov+mla/mad/msb/mls ops.

If the add/sub can synthesize immediate directly, then fused ops wont get generated. This
patch tries to address this by having makeshift higher priority for the fused ops.

Specifically, patch aims at transformation similar to below:
add ( mul, splat_vector(C))
->
      MOV C
      MAD

Differential Revision: https://reviews.llvm.org/D142656
llvm/lib/Target/AArch64/SVEInstrFormats.td
llvm/test/CodeGen/AArch64/sve-int-arith.ll