[all-commits] [llvm/llvm-project] 716e35: [DAGCombiner] skip reciprocal divisor optimization...

RotateRight via All-commits all-commits at lists.llvm.org
Sun Aug 30 08:01:52 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 716e35a0cf53e85a5fddc7ff86b79a751b1b2040
      https://github.com/llvm/llvm-project/commit/716e35a0cf53e85a5fddc7ff86b79a751b1b2040
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2020-08-30 (Sun, 30 Aug 2020)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
    M llvm/test/CodeGen/AArch64/sqrt-fastmath.ll
    M llvm/test/CodeGen/X86/sqrt-fastmath.ll

  Log Message:
  -----------
  [DAGCombiner] skip reciprocal divisor optimization for x/sqrt(x)

In general, we probably want to try the multi-use reciprocal
transform before sqrt transforms, but x/sqrt(x) is a special-case
because that will always reduce to plain sqrt(x) or an estimate.

The AArch64 tests show that the transform is limited by TLI
hook to patterns where there are 3 or more uses of the divisor.
So this change can result in an extra division compared to
what we had, but that's the intended behvior based on the
current setting of that hook.




More information about the All-commits mailing list