[PATCH] D148414: [InstCombine] Expand `foldSelectICmpAndOr` -> `foldSelectICmpAndBinOp` to work for any binop

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 29 07:38:05 PDT 2023


nikic added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp:723
 
+  // Check if this is a valid BinOp
+  switch (BinOp->getOpcode()) {
----------------
Possibly make this a check that getBinOpIdentity() with AllowRHSConstant=true is zero instead?

Or at least comment on what the criterion for valid binops is...


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D148414



More information about the llvm-commits mailing list