[PATCH] D134966: [DAG] Update foldSelectWithIdentityConstant to use llvm::isNeutralConstant

Phoebe Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 30 09:07:21 PDT 2022


pengfei accepted this revision.
pengfei added a comment.
This revision is now accepted and ready to land.

It looks to me equals to the old code.



================
Comment at: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:10753-10754
+  // TODO: The cases should match with IR's ConstantExpr::getBinOpIdentity().
+  // TODO: Target-specific opcodes could be added. Ex: "isCommutativeBinOp()".
+  // TODO: With fast-math (NSZ), allow the opposite-sign form of zero?
+  if (auto *Const = isConstOrConstSplat(V)) {
----------------
Are these two comments needed?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D134966



More information about the llvm-commits mailing list