[PATCH] D150142: [InstCombine] Add simplifications for div/rem with `i1` operands; PR62607

Noah Goldstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 8 13:31:41 PDT 2023


goldstein.w.n created this revision.
goldstein.w.n added reviewers: spatel, nikic, majnemer.
Herald added subscribers: StephenFan, hiraditya.
Herald added a project: All.
goldstein.w.n requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This is generally handled already in early CSE and/or generically with
valuetracking.

`InstCombine` assumes that div/rem with `i1` operands will have
already been handled which is not always the case if a non-standard
pipeline is being used:
https://github.com/llvm/llvm-project/issues/62607

This just adds `i1` handling to `InstructionSimplify` so that
`InstCombine's` assumptions are fulfilled by itself.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D150142

Files:
  llvm/lib/Analysis/InstructionSimplify.cpp
  llvm/test/Transforms/InstCombine/pr62607.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D150142.520472.patch
Type: text/x-patch
Size: 4685 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230508/ce73c796/attachment.bin>


More information about the llvm-commits mailing list