[all-commits] [llvm/llvm-project] 29a2b2: [SDAG] simplify FP binops to undef

RotateRight via All-commits all-commits at lists.llvm.org
Wed Mar 4 07:42:25 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 29a2b20ab363bcc0b9573e358a5ad12c0eddca86
      https://github.com/llvm/llvm-project/commit/29a2b20ab363bcc0b9573e358a5ad12c0eddca86
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2020-03-04 (Wed, 04 Mar 2020)

  Changed paths:
    M llvm/include/llvm/CodeGen/SelectionDAG.h
    M llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
    M llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
    M llvm/test/CodeGen/AArch64/fp-const-fold.ll

  Log Message:
  -----------
  [SDAG] simplify FP binops to undef

As discussed in the commit thread for rGa253a2a and D73978, we can do more undef folding for FP ops.
The nnan and ninf fast-math-flags specify that if an operand is the disallowed value, the result is
poison, so we can produce an undef result.

But this doesn't work as expected (the undef operand cases remain) because of a Flags propagation
problem in SelectionDAGBuilder.

I've added DAGCombiner calls to enable these for the other cases because we've shown in other
patches that (because of the limited way that SDAG iterates), it is possible to miss simplifications
like this if they are done only at node creation time.

Several potential follow-ups to expand on this patch are possible.

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




More information about the All-commits mailing list