-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[NFC][Load] Make ScanFrom required parameters
#100789
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NFC][Load] Make ScanFrom required parameters
#100789
Conversation
|
@llvm/pr-subscribers-llvm-analysis Author: Vitaly Buka (vitalybuka) ChangesIn #100773 we will go conservative for sanitizers, Full diff: https://github.com/llvm/llvm-project/pull/100789.diff 3 Files Affected:
diff --git a/llvm/include/llvm/Analysis/Loads.h b/llvm/include/llvm/Analysis/Loads.h
index 33e817828b754..03476ef4e14ec 100644
--- a/llvm/include/llvm/Analysis/Loads.h
+++ b/llvm/include/llvm/Analysis/Loads.h
@@ -70,7 +70,7 @@ bool isDereferenceableAndAlignedPointer(const Value *V, Align Alignment,
/// the address is already accessed.
bool isSafeToLoadUnconditionally(Value *V, Align Alignment, const APInt &Size,
const DataLayout &DL,
- Instruction *ScanFrom = nullptr,
+ Instruction *ScanFrom,
AssumptionCache *AC = nullptr,
const DominatorTree *DT = nullptr,
const TargetLibraryInfo *TLI = nullptr);
@@ -101,7 +101,7 @@ bool isDereferenceableReadOnlyLoop(Loop *L, ScalarEvolution *SE,
/// the address is already accessed.
bool isSafeToLoadUnconditionally(Value *V, Type *Ty, Align Alignment,
const DataLayout &DL,
- Instruction *ScanFrom = nullptr,
+ Instruction *ScanFrom,
AssumptionCache *AC = nullptr,
const DominatorTree *DT = nullptr,
const TargetLibraryInfo *TLI = nullptr);
diff --git a/polly/lib/Analysis/ScopBuilder.cpp b/polly/lib/Analysis/ScopBuilder.cpp
index d594823410f5f..0b9a1a916e1c1 100644
--- a/polly/lib/Analysis/ScopBuilder.cpp
+++ b/polly/lib/Analysis/ScopBuilder.cpp
@@ -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
diff --git a/polly/lib/Analysis/ScopDetection.cpp b/polly/lib/Analysis/ScopDetection.cpp
index eab7bd83e6a4e..79db3965de023 100644
--- a/polly/lib/Analysis/ScopDetection.cpp
+++ b/polly/lib/Analysis/ScopDetection.cpp
@@ -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) &&
|
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
d61be92 to
403561b
Compare
9572ea0 to
ffe82da
Compare
ffe82da to
a33fda5
Compare
403561b to
0fce1ba
Compare
nikic
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
In #100773 we will go conservative for sanitizers,
so it's better to pinpoint location consciously.
For #100639.