[all-commits] [llvm/llvm-project] 3b80d0: DAG: Look through fneg when trying to create unsaf...

Matt Arsenault via All-commits all-commits at lists.llvm.org
Mon Jan 23 02:07:38 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3b80d02992892c34c5d0860efb764d8f11352dec
      https://github.com/llvm/llvm-project/commit/3b80d02992892c34c5d0860efb764d8f11352dec
  Author: Matt Arsenault <Matthew.Arsenault at amd.com>
  Date:   2023-01-23 (Mon, 23 Jan 2023)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
    M llvm/test/CodeGen/ARM/unsafe-fneg-select-minnum-maxnum-combine.ll

  Log Message:
  -----------
  DAG: Look through fneg when trying to create unsafe minnum/maxnum

This makes most sense for isFNegFree targets, but shouldn't make
things worse without it. This avoids AMDGPU test regressions in a
future patch.

For some reason APFloat::compareAbsoluteValue is private, so compute
the neg of the constants.


  Commit: 65420c8041f4ca44a3a14c5f7faf426ee6a7c6a4
      https://github.com/llvm/llvm-project/commit/65420c8041f4ca44a3a14c5f7faf426ee6a7c6a4
  Author: Matt Arsenault <Matthew.Arsenault at amd.com>
  Date:   2023-01-23 (Mon, 23 Jan 2023)

  Changed paths:
    M llvm/include/llvm/CodeGen/TargetLowering.h
    M llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
    M llvm/test/CodeGen/ARM/unsafe-fneg-select-minnum-maxnum-combine.ll

  Log Message:
  -----------
  DAG: Use getNegatedExpression in combineMinNumMaxNum

Computing the negated RHS expression just to see if it compares equal
and throw it away feels dirty.


Compare: https://github.com/llvm/llvm-project/compare/586ce6ac9e45...65420c8041f4


More information about the All-commits mailing list