Skip to content

Commit

Permalink
[NFC][Load] Make ScanFrom required parameters
Browse files Browse the repository at this point in the history
In #100773 we will go conservative for sanitizers,
so it's better to pinpoint location consciously.

Pull Request: #100789
  • Loading branch information
vitalybuka committed Jul 26, 2024
1 parent ffe82da commit 403561b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
6 changes: 2 additions & 4 deletions llvm/include/llvm/Analysis/Loads.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ bool isDereferenceableAndAlignedPointer(const Value *V, Align Alignment,
/// quick local scan of the basic block containing ScanFrom, to determine if
/// the address is already accessed.
bool isSafeToLoadUnconditionally(Value *V, Align Alignment, const APInt &Size,
const DataLayout &DL,
Instruction *ScanFrom = nullptr,
const DataLayout &DL, Instruction *ScanFrom,
AssumptionCache *AC = nullptr,
const DominatorTree *DT = nullptr,
const TargetLibraryInfo *TLI = nullptr);
Expand Down Expand Up @@ -100,8 +99,7 @@ bool isDereferenceableReadOnlyLoop(Loop *L, ScalarEvolution *SE,
/// quick local scan of the basic block containing ScanFrom, to determine if
/// the address is already accessed.
bool isSafeToLoadUnconditionally(Value *V, Type *Ty, Align Alignment,
const DataLayout &DL,
Instruction *ScanFrom = nullptr,
const DataLayout &DL, Instruction *ScanFrom,
AssumptionCache *AC = nullptr,
const DominatorTree *DT = nullptr,
const TargetLibraryInfo *TLI = nullptr);
Expand Down
2 changes: 1 addition & 1 deletion polly/lib/Analysis/ScopBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2770,7 +2770,7 @@ isl::set ScopBuilder::getNonHoistableCtx(MemoryAccess *Access,

auto &DL = scop->getFunction().getDataLayout();
if (isSafeToLoadUnconditionally(LI->getPointerOperand(), LI->getType(),
LI->getAlign(), DL)) {
LI->getAlign(), DL, nullptr)) {
SafeToLoad = isl::set::universe(AccessRelation.get_space().range());
} else if (BB != LI->getParent()) {
// Skip accesses in non-affine subregions as they might not be executed
Expand Down
3 changes: 2 additions & 1 deletion polly/lib/Analysis/ScopDetection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,8 @@ bool ScopDetection::onlyValidRequiredInvariantLoads(

for (auto NonAffineRegion : Context.NonAffineSubRegionSet) {
if (isSafeToLoadUnconditionally(Load->getPointerOperand(),
Load->getType(), Load->getAlign(), DL))
Load->getType(), Load->getAlign(), DL,
nullptr))
continue;

if (NonAffineRegion->contains(Load) &&
Expand Down

0 comments on commit 403561b

Please sign in to comment.