aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/Loads.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2022-09-19 18:09:39 -0400
committerMatt Arsenault <Matthew.Arsenault@amd.com>2022-09-19 19:25:22 -0400
commit2adae8e1b7dfda5eb7b9a44793dd84a036a9cd15 (patch)
tree623df768dc3f98a61abae2d9141ed90b9c463df4 /llvm/lib/Analysis/Loads.cpp
parentc8674014072c0b44218776896eb38f9f8fe1abe5 (diff)
downloadllvm-2adae8e1b7dfda5eb7b9a44793dd84a036a9cd15.zip
llvm-2adae8e1b7dfda5eb7b9a44793dd84a036a9cd15.tar.gz
llvm-2adae8e1b7dfda5eb7b9a44793dd84a036a9cd15.tar.bz2
VectorCombine: Pass through AssumptionCache
Diffstat (limited to 'llvm/lib/Analysis/Loads.cpp')
-rw-r--r--llvm/lib/Analysis/Loads.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/Loads.cpp b/llvm/lib/Analysis/Loads.cpp
index 5a693c2..f2fa9e0 100644
--- a/llvm/lib/Analysis/Loads.cpp
+++ b/llvm/lib/Analysis/Loads.cpp
@@ -327,12 +327,13 @@ bool llvm::isDereferenceableAndAlignedInLoop(LoadInst *LI, Loop *L,
bool llvm::isSafeToLoadUnconditionally(Value *V, Align Alignment, APInt &Size,
const DataLayout &DL,
Instruction *ScanFrom,
+ AssumptionCache *AC,
const DominatorTree *DT,
const TargetLibraryInfo *TLI) {
// If DT is not specified we can't make context-sensitive query
const Instruction* CtxI = DT ? ScanFrom : nullptr;
- if (isDereferenceableAndAlignedPointer(V, Alignment, Size, DL, CtxI, nullptr,
- DT, TLI))
+ if (isDereferenceableAndAlignedPointer(V, Alignment, Size, DL, CtxI, AC, DT,
+ TLI))
return true;
if (!ScanFrom)
@@ -403,13 +404,15 @@ bool llvm::isSafeToLoadUnconditionally(Value *V, Align Alignment, APInt &Size,
bool llvm::isSafeToLoadUnconditionally(Value *V, Type *Ty, Align Alignment,
const DataLayout &DL,
Instruction *ScanFrom,
+ AssumptionCache *AC,
const DominatorTree *DT,
const TargetLibraryInfo *TLI) {
TypeSize TySize = DL.getTypeStoreSize(Ty);
if (TySize.isScalable())
return false;
APInt Size(DL.getIndexTypeSizeInBits(V->getType()), TySize.getFixedValue());
- return isSafeToLoadUnconditionally(V, Alignment, Size, DL, ScanFrom, DT, TLI);
+ return isSafeToLoadUnconditionally(V, Alignment, Size, DL, ScanFrom, AC, DT,
+ TLI);
}
/// DefMaxInstsToScan - the default number of maximum instructions