[llvm] [InstCombine] Simplify fractions when there is no overflow (PR #92949)

via llvm-commits llvm-commits at lists.llvm.org
Tue May 21 16:35:58 PDT 2024


AtariDreams wrote:

Anyway, in addition to the Alive2 proof, in the event I messed up there, here is how if a multiplication followed by a division does not have an unsigned wrap, a reduced fraction does:

The smallest possible greatest common factor is 1. This means the fraction is reduced. For a fraction to not be reduce, it has to have a greatest common factor of at least 2.

A division of 2 is the same as a bit shift.

https://github.com/llvm/llvm-project/pull/92949


More information about the llvm-commits mailing list