Skip to content
Commit f93b7b1c authored by Craig Topper's avatar Craig Topper
Browse files

[ValueTracking] Correct early out in computeKnownBitsFromOperator to work with...

[ValueTracking] Correct early out in computeKnownBitsFromOperator to work with non power of 2 bit widths

There's an early out that's trying to detect when we don't know any bits that make up the legal range of a shift. The code subtracts one from BitWidth which creates a mask in the lower bits for power of 2 bit widths. This is then ANDed with the known bits to see if any of those bits are known. If the bit width isn't a power of 2 this creates a non-sensical mask.

This patch corrects this by rounding up to a power of 2 before doing the subtract and mask.

Differential Revision: https://reviews.llvm.org/D34165

llvm-svn: 305400
parent 02b0e9d9
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment