[PATCH] D136472: [DAGCombiner][RISCV] Make foldBinOpIntoSelect work correctly with opaque constants.

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 21 12:58:35 PDT 2022


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

LGTM



================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:2288
+    if (BinOpcode == ISD::AND && isNullOrNullSplat(CT))
+      NewCT = DAG.getConstant(0, DL, VT);
+    else if (BinOpcode == ISD::OR && isAllOnesOrAllOnesSplat(CT))
----------------
Add a note here or to the text above to explain that we don't re-use an opaque 0/1 because that could inf-loop.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136472



More information about the llvm-commits mailing list