[knownbits] Preserve known bits for small shift recurrences
authorPhilip Reames <listmail@philipreames.com>
Fri, 12 Feb 2021 01:55:29 +0000 (17:55 -0800)
committerPhilip Reames <listmail@philipreames.com>
Fri, 12 Feb 2021 01:56:36 +0000 (17:56 -0800)
commit8ef4b961a3af6e6839b487ba3962ddad133629fc
tree293bd001e89e536fdff054ed509b7c9f949d5632
parentac2be2b6a366c05c01b8228fd804ba6ed52d320b
[knownbits] Preserve known bits for small shift recurrences

The motivation for this is that I'm looking at an example that uses shifts as induction variables. There's lots of other omissions, but one of the first I noticed is that we can't compute tight known bits. (This indirectly causes SCEV's range analysis to produce very poor results as well.)

Differential Revision: https://reviews.llvm.org/D96440
llvm/lib/Analysis/ValueTracking.cpp
llvm/test/Analysis/ValueTracking/shift-recurrence-knownbits.ll