[all-commits] [llvm/llvm-project] 098bd8: [ValueTracking] Let ComputeKnownSignBits handle (s...
Björn Pettersson via All-commits
all-commits at lists.llvm.org
Fri Jul 19 03:46:11 PDT 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 098bd842a7e50853fa231f8b73c24ec5006fe063
https://github.com/llvm/llvm-project/commit/098bd842a7e50853fa231f8b73c24ec5006fe063
Author: Bjorn Pettersson <bjorn.a.pettersson at ericsson.com>
Date: 2024-07-19 (Fri, 19 Jul 2024)
Changed paths:
M llvm/lib/Analysis/ValueTracking.cpp
M llvm/test/Analysis/ValueTracking/numsignbits-shl.ll
Log Message:
-----------
[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.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list