[all-commits] [llvm/llvm-project] 5d089d: [DAGCombiner] Fix invalid size request in combineR...

Cullen Rhodes via All-commits all-commits at lists.llvm.org
Fri Jan 28 09:01:51 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5d089d9a832c24c008ba0ecc0e28e82a7ad42297
      https://github.com/llvm/llvm-project/commit/5d089d9a832c24c008ba0ecc0e28e82a7ad42297
  Author: Cullen Rhodes <cullen.rhodes at arm.com>
  Date:   2022-01-28 (Fri, 28 Jan 2022)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
    M llvm/test/CodeGen/AArch64/fdiv-combine.ll

  Log Message:
  -----------
  [DAGCombiner] Fix invalid size request in combineRepeatedFPDivisors

If we have a vector FP division with a splatted divisor, use
getVectorMinNumElements when scaling the num of uses by splat factor.

For AArch64 the combine kicks in for the <vscale x 4 x float> case since it's
above the fdiv threshold (3) when scaling num uses by splat factor, but the
codegen is worse (splat + vector fdiv + vector fmul) than the <vscale x 2 x
double> case (splat + vector fdiv).

If the combine could be converted into a scalar FP division by
scalarizeBinOpOfSplats it may be cheaper, but it looks like this is predicated
on the isExtractVecEltCheap TLI function which is implemented for x86 but not
AArch64. Perhaps for now combineRepeatedFPDivisors should only scale num uses
by splat if the division can be converted into scalar op.

Reviewed By: sdesmalen

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




More information about the All-commits mailing list