Index: lib/Analysis/ValueTracking.cpp =================================================================== --- lib/Analysis/ValueTracking.cpp +++ lib/Analysis/ValueTracking.cpp @@ -4365,14 +4365,14 @@ if (FMF.noNaNs()) return true; - if (auto *C = dyn_cast(V)) - return !C->isNaN(); + if (auto *C = dyn_cast(V)) + return C->getType()->isFPOrFPVectorTy() && !C->isNaN(); return false; } static bool isKnownNonZero(const Value *V) { - if (auto *C = dyn_cast(V)) - return !C->isZero(); + if (auto *C = dyn_cast(V)) + return C->getType()->isFPOrFPVectorTy() && !C->isZeroValue(); return false; }