Index: lib/Analysis/ValueTracking.cpp =================================================================== --- lib/Analysis/ValueTracking.cpp +++ lib/Analysis/ValueTracking.cpp @@ -1907,15 +1907,8 @@ /// defined. Supports values with integer or pointer type and vectors of /// integers. bool isKnownNonZero(Value *V, unsigned Depth, const Query &Q) { - if (Constant *C = dyn_cast(V)) { - if (C->isNullValue()) - return false; - if (isa(C)) - // Must be non-zero due to null test above. - return true; - // TODO: Handle vectors - return false; - } + if (Constant *C = dyn_cast(V)) + return !C->isZeroValue(); if (Instruction* I = dyn_cast(V)) { if (MDNode *Ranges = I->getMetadata(LLVMContext::MD_range)) {