aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/llvm/lib/Transforms/Utils/VNCoercion.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2022-12-04 22:09:55 +0000
committerDimitry Andric <dim@FreeBSD.org>2023-02-08 19:05:19 +0000
commitf3fd488f1e19a3d09c4bdcece893901de4f49cdd (patch)
tree82183a5b9324006d7ceab77a1f77644cf9394067 /contrib/llvm-project/llvm/lib/Transforms/Utils/VNCoercion.cpp
parent6246ae0b85d8159978c01ae916a9ad6cde9378b5 (diff)
parent458532c2dd24708181cdce77b8f60938fdc90dc6 (diff)
Diffstat (limited to 'contrib/llvm-project/llvm/lib/Transforms/Utils/VNCoercion.cpp')
-rw-r--r--contrib/llvm-project/llvm/lib/Transforms/Utils/VNCoercion.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/contrib/llvm-project/llvm/lib/Transforms/Utils/VNCoercion.cpp b/contrib/llvm-project/llvm/lib/Transforms/Utils/VNCoercion.cpp
index 42be67f3cfc0..264da2187754 100644
--- a/contrib/llvm-project/llvm/lib/Transforms/Utils/VNCoercion.cpp
+++ b/contrib/llvm-project/llvm/lib/Transforms/Utils/VNCoercion.cpp
@@ -356,9 +356,9 @@ int analyzeLoadFromClobberingMemInst(Type *LoadTy, Value *LoadPtr,
// 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 (const auto *memset_inst = dyn_cast<MemSetInst>(MI)) {
if (DL.isNonIntegralPointerType(LoadTy->getScalarType())) {
- auto *CI = dyn_cast<ConstantInt>(cast<MemSetInst>(MI)->getValue());
+ auto *CI = dyn_cast<ConstantInt>(memset_inst->getValue());
if (!CI || !CI->isZero())
return -1;
}