[PATCH] D140181: DAG: Pull fneg out of select feeding fadd into fsub

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 16 04:08:32 PST 2022


arsenm added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:7013
+    SDValue RHS = Op.getOperand(2);
+    if (LHS.getOpcode() == ISD::FNEG && RHS.getOpcode() == ISD::FNEG) {
+      return DAG.getNode(ISD::SELECT, DL, VT, Op.getOperand(0),
----------------
RKSimon wrote:
> Why don't you want to use getNegatedExpression ?
This is in getNegatedExpression and it didn’t occur to be to use it recursively 


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

https://reviews.llvm.org/D140181



More information about the llvm-commits mailing list