[polly] [llvm] [AST] Don't merge memory locations in AliasSetTracker (PR #65731)

via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 12 05:57:49 PST 2023


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff a97028ac511c2cda607a1e93c3b11d654cbdbf72 7caf0bcc1cbe58590c72f00e62c077244dc8e1a4 -- llvm/include/llvm/Analysis/AliasSetTracker.h llvm/include/llvm/LinkAllPasses.h llvm/lib/Analysis/AliasSetTracker.cpp llvm/lib/Analysis/LoopAccessAnalysis.cpp llvm/lib/Transforms/Scalar/LICM.cpp llvm/lib/Transforms/Scalar/LoopVersioningLICM.cpp polly/lib/Analysis/ScopBuilder.cpp polly/lib/Analysis/ScopDetection.cpp polly/lib/Analysis/ScopDetectionDiagnostic.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/llvm/include/llvm/Analysis/AliasSetTracker.h b/llvm/include/llvm/Analysis/AliasSetTracker.h
index e8c05d2bb7..c7a48aa903 100644
--- a/llvm/include/llvm/Analysis/AliasSetTracker.h
+++ b/llvm/include/llvm/Analysis/AliasSetTracker.h
@@ -120,7 +120,7 @@ public:
   // this alias set.
   using iterator = std::vector<MemoryLocation>::const_iterator;
   iterator begin() const { return MemoryLocs.begin(); }
-  iterator end()   const { return MemoryLocs.end(); }
+  iterator end() const { return MemoryLocs.end(); }
 
   unsigned size() { return MemoryLocs.size(); }
 
@@ -130,8 +130,7 @@ public:
 private:
   // Can only be created by AliasSetTracker.
   AliasSet()
-      : RefCount(0), AliasAny(false), Access(NoAccess),
-        Alias(SetMustAlias) {}
+      : RefCount(0), AliasAny(false), Access(NoAccess), Alias(SetMustAlias) {}
 
   /// Return the real alias set this represents. If this has been merged with
   /// another set and is forwarding, return the ultimate destination set. This
@@ -158,7 +157,8 @@ private:
 public:
   /// If the specified pointer "may" (or must) alias one of the members in the
   /// set return the appropriate AliasResult. Otherwise return NoAlias.
-  AliasResult aliasesPointer(const MemoryLocation &MemLoc, BatchAAResults &AA) const;
+  AliasResult aliasesPointer(const MemoryLocation &MemLoc,
+                             BatchAAResults &AA) const;
 
   ModRefInfo aliasesUnknownInst(const Instruction *Inst,
                                 BatchAAResults &AA) const;
diff --git a/llvm/lib/Analysis/AliasSetTracker.cpp b/llvm/lib/Analysis/AliasSetTracker.cpp
index 579070b255..3ccff00a72 100644
--- a/llvm/lib/Analysis/AliasSetTracker.cpp
+++ b/llvm/lib/Analysis/AliasSetTracker.cpp
@@ -40,7 +40,8 @@ static cl::opt<unsigned>
                         cl::desc("The maximum number of pointers may-alias "
                                  "sets may contain before degradation"));
 
-bool AliasSet::isMustAliasMergeWith(AliasSet &AS, BatchAAResults &BatchAA) const {
+bool AliasSet::isMustAliasMergeWith(AliasSet &AS,
+                                    BatchAAResults &BatchAA) const {
   for (const MemoryLocation &MemLoc : MemoryLocs)
     for (const MemoryLocation &ASMemLoc : AS.MemoryLocs)
       if (!BatchAA.isMustAlias(MemLoc, ASMemLoc))
@@ -153,7 +154,8 @@ void AliasSet::addUnknownInst(Instruction *I, BatchAAResults &AA) {
 /// members in the set return the appropriate AliasResult. Otherwise return
 /// NoAlias.
 ///
-AliasResult AliasSet::aliasesPointer(const MemoryLocation &MemLoc, BatchAAResults &AA) const {
+AliasResult AliasSet::aliasesPointer(const MemoryLocation &MemLoc,
+                                     BatchAAResults &AA) const {
   if (AliasAny)
     return AliasResult::MayAlias;
 
@@ -210,8 +212,9 @@ void AliasSetTracker::clear() {
 /// alias the pointer. Return the unified set, or nullptr if no set that aliases
 /// the pointer was found. MustAliasAll is updated to true/false if the pointer
 /// is found to MustAlias all the sets it merged.
-AliasSet *AliasSetTracker::mergeAliasSetsForPointer(const MemoryLocation &MemLoc,
-                                                    bool &MustAliasAll) {
+AliasSet *
+AliasSetTracker::mergeAliasSetsForPointer(const MemoryLocation &MemLoc,
+                                          bool &MustAliasAll) {
   AliasSet *FoundSet = nullptr;
   MustAliasAll = true;
   for (AliasSet &AS : llvm::make_early_inc_range(*this)) {
@@ -275,7 +278,8 @@ AliasSet &AliasSetTracker::getAliasSetFor(const MemoryLocation &MemLoc) {
     // consistent.
     // This, of course, means that we will never need a merge here.
     AS = AliasAnyAS;
-  } else if (AliasSet *AliasAS = mergeAliasSetsForPointer(MemLoc, MustAliasAll)) {
+  } else if (AliasSet *AliasAS =
+                 mergeAliasSetsForPointer(MemLoc, MustAliasAll)) {
     // Add it to the alias set it aliases.
     AS = AliasAS;
   } else {

``````````

</details>


https://github.com/llvm/llvm-project/pull/65731


More information about the llvm-commits mailing list