[PATCH] D142656: [SVE][codegen] Add pattern for SVE multiply-add accumulate

David Sherwood via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 1 03:10:16 PST 2023


david-arm added a comment.

Hi @SjoerdMeijer, in @sushgokh's defence there is precedent for some of the changes in this patch - by changing from SVE_4_Op_Pat to SVE_4_Mad_Op_Pat we are able to set the AddedComplexity field to the pattern, which is not dissimilar to SVE_3_Op_Pat_SelZero or SVE_3_Op_Pat_Shift_Imm_SelZero, i.e.

  let AddedComplexity = 1 in {
  class SVE_3_Op_Pat_SelZero<ValueType vtd, SDPatternOperator op, ValueType vt1,
                     ValueType vt2, ValueType vt3, Instruction inst>
  : Pat<(vtd (vtd (op vt1:$Op1, (vselect vt1:$Op1, vt2:$Op2, (SVEDup0)), vt3:$Op3))),
        (inst $Op1, $Op2, $Op3)>;
  
  class SVE_3_Op_Pat_Shift_Imm_SelZero<ValueType vtd, SDPatternOperator op,
                                       ValueType vt1, ValueType vt2,
                                       Operand vt3, Instruction inst>
  : Pat<(vtd (op vt1:$Op1, (vselect vt1:$Op1, vt2:$Op2, (SVEDup0)), (i32 (vt3:$Op3)))),
        (inst $Op1, $Op2, vt3:$Op3)>;
  }

What I don't fully understand is why the complexity has to be so high, since it suggests there are multiple competing patterns and it might be useful to understand what they are. I admit that `AArch64mul_p_firstOpndWithSingleUse` looks a bit unusual and I'm not sure that we should be checking for explicit opcodes such as TokenFactor, etc.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142656/new/

https://reviews.llvm.org/D142656



More information about the llvm-commits mailing list