Skip to content

Commit 4664a4c

Browse files
committed
[LAA] Use getPointer/setPointer in createCheckForAccess (NFC).
Use getPointer/setPointer to clarify we are accessing/modifying the rurrent value.
1 parent 21e956d commit 4664a4c

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

llvm/lib/Analysis/LoopAccessAnalysis.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1143,9 +1143,8 @@ bool AccessAnalysis::createCheckForAccess(RuntimePointerChecking &RtCheck,
11431143
SmallVector<PointerIntPair<const SCEV *, 1, bool>> TranslatedPtrs =
11441144
findForkedPointer(PSE, StridesMap, Ptr, TheLoop);
11451145

1146-
for (const auto &P : TranslatedPtrs) {
1147-
const SCEV *PtrExpr = get<0>(P);
1148-
if (!hasComputableBounds(PSE, Ptr, PtrExpr, TheLoop, Assume))
1146+
for (auto &P : TranslatedPtrs) {
1147+
if (!hasComputableBounds(PSE, Ptr, P.getPointer(), TheLoop, Assume))
11491148
return false;
11501149

11511150
// When we run after a failing dependency check we have to make sure
@@ -1161,8 +1160,7 @@ bool AccessAnalysis::createCheckForAccess(RuntimePointerChecking &RtCheck,
11611160
// If there's only one option for Ptr, look it up after bounds and wrap
11621161
// checking, because assumptions might have been added to PSE.
11631162
if (TranslatedPtrs.size() == 1)
1164-
TranslatedPtrs[0] = {replaceSymbolicStrideSCEV(PSE, StridesMap, Ptr),
1165-
false};
1163+
P.setPointer(replaceSymbolicStrideSCEV(PSE, StridesMap, Ptr));
11661164
}
11671165

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

0 commit comments

Comments
 (0)