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

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 30 09:14:23 PDT 2022


RKSimon added inline comments.


================
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)) {
----------------
pengfei wrote:
> Are these two comments needed?
The NSZ TODO can certainly go - I haven't come across any real world cases where target opcodes would be useful yet, but theoretically they could be, so I might keep that one.

The getBinOpIdentity TODO should probably be a NOTE instead


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