diff --git a/llvm/lib/Transforms/Utils/VNCoercion.cpp b/llvm/lib/Transforms/Utils/VNCoercion.cpp --- a/llvm/lib/Transforms/Utils/VNCoercion.cpp +++ b/llvm/lib/Transforms/Utils/VNCoercion.cpp @@ -356,7 +356,7 @@ // If this is memset, we just need to see if the offset is valid in the size // of the memset.. - if (MI->getIntrinsicID() == Intrinsic::memset) { + if (isa(MI)) { if (DL.isNonIntegralPointerType(LoadTy->getScalarType())) { auto *CI = dyn_cast(cast(MI)->getValue()); if (!CI || !CI->isZero())