[PATCH] D30311: [ValueTracking] Don't do an unchecked shift in ComputeNumSignBits
David Majnemer via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 24 02:29:52 PST 2017
majnemer accepted this revision.
majnemer added a comment.
This revision is now accepted and ready to land.
LGTM
================
Comment at: lib/Analysis/ValueTracking.cpp:2210
+ unsigned ShAmtLimited = ShAmt->getLimitedValue(TyBits);
+ if (ShAmtLimited == TyBits)
+ break; // Bad shift.
----------------
sanjoy wrote:
> majnemer wrote:
> > Should it be == or >= ?
> The `getLimitedValue` would've taken care about the `>` case. Though -- I can change it to `getZExtValue()` if you want.
Ah, I see. I think it'd be slightly more clear if we used getZExtValue here.
https://reviews.llvm.org/D30311
More information about the llvm-commits
mailing list