[PATCH] D62774: [DAGCombine][X86][AArch64][MIPS][LANAI] (C - x) - y -> C - (x + y) fold (PR41952)

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 1 11:01:12 PDT 2019


RKSimon edited reviewers, added: efriedma; removed: eli.friedman.
RKSimon added inline comments.


================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:3017
   }
+  // (C - x) - y  ->  C - (x + y)
+  if (N0.hasOneUse() && N0.getOpcode() == ISD::SUB &&
----------------
Do we gain anything from the general case here? This seems to cause a small increase in register pressure in many cases - limit to the (0 - x) - y negation case only?


Repository:
  rL LLVM

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

https://reviews.llvm.org/D62774





More information about the llvm-commits mailing list