[PATCH] D159203: [InstCombine] Fold (A/-B)==(A/B) to (A/B)==0

Marc Auberer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 30 07:09:33 PDT 2023


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

Fixes #62382: https://github.com/llvm/llvm-project/issues/62382

This optimization applies under the precondition, that B is not equal to the minimum
value for the bitwidth of B, e.g. -128 for i8.

Alive2: https://alive2.llvm.org/ce/z/WIiHur
Baseline tests: <insert-test-rev-here>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D159203

Files:
  llvm/include/llvm/Analysis/ValueTracking.h
  llvm/lib/Analysis/ValueTracking.cpp
  llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
  llvm/test/Transforms/InstCombine/icmp-sdiv-sdiv.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D159203.554705.patch
Type: text/x-patch
Size: 5459 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230830/0044c56a/attachment.bin>


More information about the llvm-commits mailing list