diff --git a/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp b/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp index 8c389475a2c7..adb089ece60b 100644 --- a/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp +++ b/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp @@ -277,7 +277,7 @@ static bool isObjectPointerWithTrustworthySize(const Value *V) { if (const AllocaInst *AI = dyn_cast(V)) return !AI->isArrayAllocation(); if (const GlobalVariable *GV = dyn_cast(V)) - return !GV->isWeakForLinker(); + return !GV->mayBeOverridden(); if (const Argument *A = dyn_cast(V)) return A->hasByValAttr(); return false;