This is an archive of the discontinued LLVM Phabricator instance.

[InstCombine] Remove explicit check for impossible condition. Replace with assert
ClosedPublic

Authored by craig.topper on Jul 31 2017, 4:40 PM.

Details

Summary

As far as I can tell the earlier call getLimitedValue will guaranteed ShiftAmt is saturated to BitWidth-1 preventing it from ever being equal or greater than BitWidth.

At one point in the past the getLimitedValue call was only passed BitWidth not BitWidth - 1. This would have allowed the equality case to get here. And in fact this check was initially added as just BitWidth == ShiftAmt, but was changed shortly after to include > which should have never been possible.

Diff Detail

Event Timeline

craig.topper created this revision.Jul 31 2017, 4:40 PM
davide accepted this revision.Jul 31 2017, 10:43 PM

LGTM

This revision is now accepted and ready to land.Jul 31 2017, 10:43 PM
This revision was automatically updated to reflect the committed changes.