Skip to content

Commit 9d46557

Browse files
gchatelettru
authored andcommitted
Take memset_inline into account in analyzeLoadFromClobberingMemInst
This appeared in https://reviews.llvm.org/D126903#3884061 Differential Revision: https://reviews.llvm.org/D136752 (cherry picked from commit 1a726cf)
1 parent dd711a9 commit 9d46557

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/Transforms/Utils/VNCoercion.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,9 +356,9 @@ int analyzeLoadFromClobberingMemInst(Type *LoadTy, Value *LoadPtr,
356356

357357
// If this is memset, we just need to see if the offset is valid in the size
358358
// of the memset..
359-
if (MI->getIntrinsicID() == Intrinsic::memset) {
359+
if (const auto *memset_inst = dyn_cast<MemSetInst>(MI)) {
360360
if (DL.isNonIntegralPointerType(LoadTy->getScalarType())) {
361-
auto *CI = dyn_cast<ConstantInt>(cast<MemSetInst>(MI)->getValue());
361+
auto *CI = dyn_cast<ConstantInt>(memset_inst->getValue());
362362
if (!CI || !CI->isZero())
363363
return -1;
364364
}

0 commit comments

Comments
 (0)