[PATCH] D150648: [KnownBits] Return zero instead of unknown for always poison shifts

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 16 02:01:43 PDT 2023


nikic added a comment.

In D150648#4345159 <https://reviews.llvm.org/D150648#4345159>, @foad wrote:

> Shouldn't something have simplified these shifts to poison already?
>
> No objection to the patch.

On the IR level, yes, we do that here: https://github.com/llvm/llvm-project/blob/bba9209f1d198efc7e492f0e273fff0b0a5ef060/llvm/lib/Analysis/InstructionSimplify.cpp#L1361-L1365 The changes in InstCombine are because the shift is a constant expression, so these don't get simplified (until I get around to removing support for shift expressions...) The backend doesn't have something equivalent (and probably shouldn't have it -- doesn't seem like something that is valuable enough to compute known bits for).


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D150648/new/

https://reviews.llvm.org/D150648



More information about the llvm-commits mailing list