summaryrefslogtreecommitdiff
path: root/lib/Analysis/Loads.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Analysis/Loads.cpp')
-rw-r--r--lib/Analysis/Loads.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/Analysis/Loads.cpp b/lib/Analysis/Loads.cpp
index 591b0fc481d2..834727c9224d 100644
--- a/lib/Analysis/Loads.cpp
+++ b/lib/Analysis/Loads.cpp
@@ -72,7 +72,7 @@ static bool isDereferenceableAndAlignedPointer(
V->getPointerDereferenceableBytes(DL, CheckForNonNull));
if (KnownDerefBytes.getBoolValue()) {
if (KnownDerefBytes.uge(Size))
- if (!CheckForNonNull || isKnownNonNullAt(V, CtxI, DT))
+ if (!CheckForNonNull || isKnownNonZero(V, DL, 0, nullptr, CtxI, DT))
return isAligned(V, Align, DL);
}
@@ -414,7 +414,7 @@ Value *llvm::FindAvailablePtrLoadStore(Value *Ptr, Type *AccessTy,
// If we have alias analysis and it says the store won't modify the loaded
// value, ignore the store.
- if (AA && (AA->getModRefInfo(SI, StrippedPtr, AccessSize) & MRI_Mod) == 0)
+ if (AA && !isModSet(AA->getModRefInfo(SI, StrippedPtr, AccessSize)))
continue;
// Otherwise the store that may or may not alias the pointer, bail out.
@@ -426,8 +426,7 @@ Value *llvm::FindAvailablePtrLoadStore(Value *Ptr, Type *AccessTy,
if (Inst->mayWriteToMemory()) {
// If alias analysis claims that it really won't modify the load,
// ignore it.
- if (AA &&
- (AA->getModRefInfo(Inst, StrippedPtr, AccessSize) & MRI_Mod) == 0)
+ if (AA && !isModSet(AA->getModRefInfo(Inst, StrippedPtr, AccessSize)))
continue;
// May modify the pointer, bail out.