[llvm] 4664a4c - [LAA] Use getPointer/setPointer in createCheckForAccess (NFC).

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 15 07:18:32 PST 2025


Author: Florian Hahn
Date: 2025-02-15T16:17:42+01:00
New Revision: 4664a4c66b816af53f596935c3aaa2eca143ae9c

URL: https://github.com/llvm/llvm-project/commit/4664a4c66b816af53f596935c3aaa2eca143ae9c
DIFF: https://github.com/llvm/llvm-project/commit/4664a4c66b816af53f596935c3aaa2eca143ae9c.diff

LOG: [LAA] Use getPointer/setPointer in createCheckForAccess (NFC).

Use getPointer/setPointer to clarify we are accessing/modifying the
rurrent value.

Added: 
    

Modified: 
    llvm/lib/Analysis/LoopAccessAnalysis.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Analysis/LoopAccessAnalysis.cpp b/llvm/lib/Analysis/LoopAccessAnalysis.cpp
index 4bdcccdae0b7e..e5b87d2d16230 100644
--- a/llvm/lib/Analysis/LoopAccessAnalysis.cpp
+++ b/llvm/lib/Analysis/LoopAccessAnalysis.cpp
@@ -1143,9 +1143,8 @@ bool AccessAnalysis::createCheckForAccess(RuntimePointerChecking &RtCheck,
   SmallVector<PointerIntPair<const SCEV *, 1, bool>> TranslatedPtrs =
       findForkedPointer(PSE, StridesMap, Ptr, TheLoop);
 
-  for (const auto &P : TranslatedPtrs) {
-    const SCEV *PtrExpr = get<0>(P);
-    if (!hasComputableBounds(PSE, Ptr, PtrExpr, TheLoop, Assume))
+  for (auto &P : TranslatedPtrs) {
+    if (!hasComputableBounds(PSE, Ptr, P.getPointer(), TheLoop, Assume))
       return false;
 
     // When we run after a failing dependency check we have to make sure
@@ -1161,8 +1160,7 @@ bool AccessAnalysis::createCheckForAccess(RuntimePointerChecking &RtCheck,
     // If there's only one option for Ptr, look it up after bounds and wrap
     // checking, because assumptions might have been added to PSE.
     if (TranslatedPtrs.size() == 1)
-      TranslatedPtrs[0] = {replaceSymbolicStrideSCEV(PSE, StridesMap, Ptr),
-                           false};
+      P.setPointer(replaceSymbolicStrideSCEV(PSE, StridesMap, Ptr));
   }
 
   for (auto [PtrExpr, NeedsFreeze] : TranslatedPtrs) {


        


More information about the llvm-commits mailing list