Skip to content

Commit 0fce1ba

Browse files
committed
[NFC][Load] Make ScanFrom required parameters
In #100773 we will go conservative for sanitizers, so it's better to pinpoint location consciously. Pull Request: #100789
1 parent a33fda5 commit 0fce1ba

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

llvm/include/llvm/Analysis/Loads.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@ bool isDereferenceableAndAlignedPointer(const Value *V, Align Alignment,
6969
/// quick local scan of the basic block containing ScanFrom, to determine if
7070
/// the address is already accessed.
7171
bool isSafeToLoadUnconditionally(Value *V, Align Alignment, const APInt &Size,
72-
const DataLayout &DL,
73-
Instruction *ScanFrom = nullptr,
72+
const DataLayout &DL, Instruction *ScanFrom,
7473
AssumptionCache *AC = nullptr,
7574
const DominatorTree *DT = nullptr,
7675
const TargetLibraryInfo *TLI = nullptr);
@@ -100,8 +99,7 @@ bool isDereferenceableReadOnlyLoop(Loop *L, ScalarEvolution *SE,
10099
/// quick local scan of the basic block containing ScanFrom, to determine if
101100
/// the address is already accessed.
102101
bool isSafeToLoadUnconditionally(Value *V, Type *Ty, Align Alignment,
103-
const DataLayout &DL,
104-
Instruction *ScanFrom = nullptr,
102+
const DataLayout &DL, Instruction *ScanFrom,
105103
AssumptionCache *AC = nullptr,
106104
const DominatorTree *DT = nullptr,
107105
const TargetLibraryInfo *TLI = nullptr);

polly/lib/Analysis/ScopBuilder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2770,7 +2770,7 @@ isl::set ScopBuilder::getNonHoistableCtx(MemoryAccess *Access,
27702770

27712771
auto &DL = scop->getFunction().getDataLayout();
27722772
if (isSafeToLoadUnconditionally(LI->getPointerOperand(), LI->getType(),
2773-
LI->getAlign(), DL)) {
2773+
LI->getAlign(), DL, nullptr)) {
27742774
SafeToLoad = isl::set::universe(AccessRelation.get_space().range());
27752775
} else if (BB != LI->getParent()) {
27762776
// Skip accesses in non-affine subregions as they might not be executed

polly/lib/Analysis/ScopDetection.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,8 @@ bool ScopDetection::onlyValidRequiredInvariantLoads(
490490

491491
for (auto NonAffineRegion : Context.NonAffineSubRegionSet) {
492492
if (isSafeToLoadUnconditionally(Load->getPointerOperand(),
493-
Load->getType(), Load->getAlign(), DL))
493+
Load->getType(), Load->getAlign(), DL,
494+
nullptr))
494495
continue;
495496

496497
if (NonAffineRegion->contains(Load) &&

0 commit comments

Comments
 (0)