[PATCH] D20544: [ValueTracking, InstSimplify] extend isKnownNonZero() to handle vector constants
David Majnemer via llvm-commits
llvm-commits at lists.llvm.org
Mon May 23 16:21:05 PDT 2016
majnemer accepted this revision.
majnemer added a comment.
This revision is now accepted and ready to land.
LGTM with nits.
================
Comment at: lib/Analysis/ValueTracking.cpp:1686-1689
@@ +1685,6 @@
+ for (unsigned i = 0, e = VTy->getNumElements(); i != e; ++i) {
+ Constant *Elt = C->getAggregateElement(i);
+ if (!Elt || Elt->isNullValue() ||
+ (!isa<UndefValue>(Elt) && !isa<ConstantInt>(Elt)))
+ return false;
+ }
----------------
Might be easier to read as:
Constant *Elt = C->getAggregateElement(i);
if (!Elt || Elt->isNullValue())
return false;
if (!isa<UndefValue>(Elt) && !isa<ConstantInt>(Elt))
return false;
While it is a little more code, I think it's a little easier to follow along.
http://reviews.llvm.org/D20544
More information about the llvm-commits
mailing list