[InstCombine] Use KnownBits::urem() helper
authorNikita Popov <npopov@redhat.com>
Wed, 17 May 2023 15:12:32 +0000 (17:12 +0200)
committerNikita Popov <npopov@redhat.com>
Wed, 17 May 2023 15:14:54 +0000 (17:14 +0200)
commit4ca30ded4f07b192b8a8bed069400f9d6b85a792
tree8d09b0115b085be60db0c331f20307cf79e09618
parent2f3ac28cb2f7fc24c6ff742af571b58419c0adaa
[InstCombine] Use KnownBits::urem() helper

This provides more precise results than the ad-hoc implementation.
Noticed while trying to add a consistency assertion.

To be honest I'm not sure why this code exists at all -- the
recursive calls are done with all bits demanded, so this should
be equivalent to just using the default case.
llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp