[PATCH] D111319: [GlobalISel] Combine for eliminating redundant operand negations

Mirko Brkusanin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 8 04:36:42 PDT 2021


mbrkusanin added inline comments.


================
Comment at: llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h:620-622
+  /// Transform (fadd x, fneg(y)) -> (fsub x, y)
+  ///           (fadd fneg(x), y) -> (fsub y, x)
+  ///           (fsub x, fneg(y)) -> (fadd x, y)
----------------
foad wrote:
> Are these definitely safe. even with signed zeros? Does SelectionDAG do the same?
SelectionDAG does not have any extra checks for these specific combines (unlike for some others) so I assume it's safe.
Equivalent SDAG combines are in DAGCombiner::visitFADD and DAGCombiner::visitFSUB.


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

https://reviews.llvm.org/D111319



More information about the llvm-commits mailing list