We currently don't call into KnownBits::shl from ValueTracking if the shift amount is unknown. If we do try to do so, we get significant compile-time regressions, because evaluating all 64 shift amounts if quite expensive, and mostly pointless in this case. Add a fast-path for the case where the shift amount is the full [0, BitWidth-1] range. This primarily requires a more accurate estimate of the max shift amount, to avoid taking the fast-path in too many cases.
Details
Details
Diff Detail
Diff Detail
Do we still need all this logic now that you have determined the max shift amount in advance?