[PATCH] D30311: [ValueTracking] Don't do an unchecked shift in ComputeNumSignBits
Sanjoy Das via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 23 17:47:14 PST 2017
sanjoy added inline comments.
================
Comment at: lib/Analysis/ValueTracking.cpp:2210
+ unsigned ShAmtLimited = ShAmt->getLimitedValue(TyBits);
+ if (ShAmtLimited == TyBits)
+ break; // Bad shift.
----------------
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.
https://reviews.llvm.org/D30311
More information about the llvm-commits
mailing list