[PATCH] D151631: [InstSimplify] Simplify select i1 ConstExpr, i1 true, i1 false to ConstExpr

luxufan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun May 28 08:11:09 PDT 2023


StephenFan created this revision.
StephenFan added a reviewer: nikic.
Herald added a subscriber: hiraditya.
Herald added a project: All.
StephenFan requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

`select i1 non-const, i1 true, i1 false` has been optimized to
`non-const`. There is no reason that we can not optimize `select i1
ConstExpr, i1 true, i1 false` to `ConstExpr`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D151631

Files:
  llvm/lib/Analysis/InstructionSimplify.cpp
  llvm/test/Transforms/InstSimplify/select-inseltpoison.ll
  llvm/test/Transforms/InstSimplify/select.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D151631.526334.patch
Type: text/x-patch
Size: 7291 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230528/42908f5d/attachment.bin>


More information about the llvm-commits mailing list