[PATCH] D133866: [SelectionDAG] Add helper function to check whether a SDValue is neutral element. NFC.

Yeting Kuo via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 27 20:02:30 PDT 2022


fakepaper56 marked an inline comment as done.
fakepaper56 added inline comments.


================
Comment at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1696
+bool isNeutralConstant(unsigned Opc, SDNodeFlags Flags, SDValue V,
+                       unsigned OpereandNo);
+
----------------
RKSimon wrote:
> OperandNo
Done.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:10771
+    case ISD::FSUB:
+      return ConstFP->isZero() &&
+             (Flags.hasNoSignedZeros() || !ConstFP->isNegative());
----------------
RKSimon wrote:
> Missing OperandNo == 1 check
Done.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D133866



More information about the llvm-commits mailing list