Skip to content

Commit e60de25

Browse files
committed
[LAA] Replace symbolic strides for translated pointers earlier (NFC).
Move up replaceSymbolicStrideSCEV before isNoWrap. It needs to be called after hasComputableBounds, as this may create an AddRec via PSE, which replaceSymbolicStrideSCEV will look up. This is in preparation for simplifying isNoWrap.
1 parent 948e97a commit e60de25

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

llvm/lib/Analysis/LoopAccessAnalysis.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,6 +1147,11 @@ bool AccessAnalysis::createCheckForAccess(RuntimePointerChecking &RtCheck,
11471147
if (!hasComputableBounds(PSE, Ptr, P.getPointer(), TheLoop, Assume))
11481148
return false;
11491149

1150+
// If there's only one option for Ptr, look it up after bounds and wrap
1151+
// checking, because assumptions might have been added to PSE.
1152+
if (TranslatedPtrs.size() == 1)
1153+
P.setPointer(replaceSymbolicStrideSCEV(PSE, StridesMap, Ptr));
1154+
11501155
// When we run after a failing dependency check we have to make sure
11511156
// we don't have wrapping pointers.
11521157
if (ShouldCheckWrap) {
@@ -1157,10 +1162,6 @@ bool AccessAnalysis::createCheckForAccess(RuntimePointerChecking &RtCheck,
11571162
if (!isNoWrap(PSE, StridesMap, Ptr, AccessTy, TheLoop, Assume))
11581163
return false;
11591164
}
1160-
// If there's only one option for Ptr, look it up after bounds and wrap
1161-
// checking, because assumptions might have been added to PSE.
1162-
if (TranslatedPtrs.size() == 1)
1163-
P.setPointer(replaceSymbolicStrideSCEV(PSE, StridesMap, Ptr));
11641165
}
11651166

11661167
for (auto [PtrExpr, NeedsFreeze] : TranslatedPtrs) {

0 commit comments

Comments
 (0)