[PATCH] D136472: [DAGCombiner][RISCV] Make foldBinOpIntoSelect work correctly with opaque constants.
Craig Topper via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 21 13:26:57 PDT 2022
craig.topper added inline comments.
================
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))
----------------
spatel wrote:
> 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.
The 0/-1 weren’t opaque. I was just being paranoid about using 0/-1 that might be mixed with undef. Do I need to worry about that here?
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