[PATCH] D12799: [ValueTracking] Teach isKnownNonZero a new trick
hfinkel@anl.gov via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 18 20:00:00 PDT 2015
hfinkel added inline comments.
================
Comment at: lib/Analysis/ValueTracking.cpp:1832
@@ +1831,3 @@
+ if (ConstantInt *Shift = dyn_cast<ConstantInt>(Y))
+ if (Shift->getLimitedValue() < BitWidth) {
+ APInt KnownZero(BitWidth, 0);
----------------
I don't think this check is necessary, and you can just use Shift->getLimitedValue(BitWidth-1) below, because it is undefined behavior for the number to be larger than that regardless.
Repository:
rL LLVM
http://reviews.llvm.org/D12799
More information about the llvm-commits
mailing list