Index: lib/Analysis/Loads.cpp =================================================================== --- lib/Analysis/Loads.cpp +++ lib/Analysis/Loads.cpp @@ -116,7 +116,7 @@ // We can at least always strip pointer casts even though we can't use the // base here. - V = V->stripPointerCasts(); + V = V->stripPointerCasts(/*LookThroughNoAlias*/true); while (BBI != E) { --BBI; @@ -140,7 +140,7 @@ return true; auto *AccessedTy = cast(AccessedPtr->getType()); - if (AreEquivalentAddressValues(AccessedPtr->stripPointerCasts(), V) && + if (AreEquivalentAddressValues(AccessedPtr->stripPointerCasts(true), V) && LoadSize <= DL.getTypeStoreSize(AccessedTy->getElementType())) return true; }