[PATCH] D136164: [MemorySSA] Use BatchAA for clobber walker

Alina Sbirlea via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 15 14:49:41 PST 2022


asbirlea added a comment.

Makes sense to use BAA at call sites if the usage is such!

Regarding the internal walker APIs, please see the inline comments. I don't think we need to pass the BAA instance everywhere, that was the goal of the class fields.



================
Comment at: llvm/lib/Analysis/MemorySSA.cpp:520
   const MemorySSA &MSSA;
-  AliasAnalysisType &AA;
   DominatorTree &DT;
----------------
Keep a pointer to a BatchAA instance - set when Query is created. Prevents having to pass it through all the APIs.


================
Comment at: llvm/lib/Analysis/MemorySSA.cpp:559
   UpwardsWalkResult
-  walkToPhiOrClobber(DefPath &Desc, const MemoryAccess *StopAt = nullptr,
+  walkToPhiOrClobber(BatchAAResults &BAA, DefPath &Desc,
+                     const MemoryAccess *StopAt = nullptr,
----------------
Use class BAA.


================
Comment at: llvm/lib/Analysis/MemorySSA.cpp:626
   Optional<TerminatedPath>
-  getBlockingAccess(const MemoryAccess *StopWhere,
+  getBlockingAccess(BatchAAResults &BAA, const MemoryAccess *StopWhere,
                     SmallVectorImpl<ListIndex> &PausedSearches,
----------------
Use class BAA.


================
Comment at: llvm/lib/Analysis/MemorySSA.cpp:768
   /// terminates when a MemoryAccess that clobbers said MemoryLocation is found.
-  OptznResult tryOptimizePhi(MemoryPhi *Phi, MemoryAccess *Start,
-                             const MemoryLocation &Loc) {
+  OptznResult tryOptimizePhi(BatchAAResults &BAA, MemoryPhi *Phi,
+                             MemoryAccess *Start, const MemoryLocation &Loc) {
----------------
Use class BAA.


================
Comment at: llvm/lib/Analysis/MemorySSA.cpp:936
+                            UpwardsMemoryQuery &Q, unsigned &UpWalkLimit) {
     Query = &Q;
     UpwardWalkLimit = &UpWalkLimit;
----------------
Set class BAA here, the same as Query.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D136164/new/

https://reviews.llvm.org/D136164



More information about the llvm-commits mailing list