llvm-project
098bd842 - [ValueTracking] Let ComputeKnownSignBits handle (shl (zext X), C) (#97693)

Commit
1 year ago
[ValueTracking] Let ComputeKnownSignBits handle (shl (zext X), C) (#97693) Add simple support for looking through a zext when doing ComputeKnownSignBits for shl. This is valid for the case when all extended bits are shifted out, because then the number of sign bits can be found by analysing the zext operand. The solution here is simple as it only handle a single zext (not passing remaining left shift amount during recursion). It could be possible to generalize this in the future by for example passing an 'OffsetFromMSB' parameter to ComputeNumSignBitsImpl, telling it to calculate number of sign bits starting at some offset from the most significant bit.
Author
Committer
Parents
Loading