[NFC] Reduce include files dependency.

1. Removed #include "...AliasAnalysis.h" in other headers and modules.
2. Cleaned up includes in AliasAnalysis.h.

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D92489

GitOrigin-RevId: 2ce38b3f038482e9d21661d1b328a42664301f03
diff --git a/include/polly/ScopBuilder.h b/include/polly/ScopBuilder.h
index e1d1c78..7bed07c 100644
--- a/include/polly/ScopBuilder.h
+++ b/include/polly/ScopBuilder.h
@@ -31,8 +31,8 @@
 /// Build the Polly IR (Scop and ScopStmt) on a Region.
 class ScopBuilder {
 
-  /// The AliasAnalysis to build AliasSetTracker.
-  AliasAnalysis &AA;
+  /// The AAResults to build AliasSetTracker.
+  AAResults &AA;
 
   /// Target data for element size computing.
   const DataLayout &DL;
@@ -823,7 +823,7 @@
   void buildSchedule(RegionNode *RN, LoopStackTy &LoopStack);
 
 public:
-  explicit ScopBuilder(Region *R, AssumptionCache &AC, AliasAnalysis &AA,
+  explicit ScopBuilder(Region *R, AssumptionCache &AC, AAResults &AA,
                        const DataLayout &DL, DominatorTree &DT, LoopInfo &LI,
                        ScopDetection &SD, ScalarEvolution &SE,
                        OptimizationRemarkEmitter &ORE);
diff --git a/include/polly/ScopDetection.h b/include/polly/ScopDetection.h
index ead8079..f28ab49 100644
--- a/include/polly/ScopDetection.h
+++ b/include/polly/ScopDetection.h
@@ -48,7 +48,6 @@
 
 #include "polly/ScopDetectionDiagnostic.h"
 #include "polly/Support/ScopHelper.h"
-#include "llvm/Analysis/AliasAnalysis.h"
 #include "llvm/Analysis/AliasSetTracker.h"
 #include "llvm/Analysis/RegionInfo.h"
 #include "llvm/Analysis/ScalarEvolutionExpressions.h"
@@ -58,6 +57,8 @@
 using namespace llvm;
 
 namespace llvm {
+class AAResults;
+
 void initializeScopDetectionWrapperPassPass(PassRegistry &);
 } // namespace llvm
 
@@ -161,7 +162,7 @@
     MapInsnToMemAcc InsnToMemAcc;
 
     /// Initialize a DetectionContext from scratch.
-    DetectionContext(Region &R, AliasAnalysis &AA, bool Verify)
+    DetectionContext(Region &R, AAResults &AA, bool Verify)
         : CurRegion(R), AST(AA), Verifying(Verify), Log(&R) {}
 
     /// Initialize a DetectionContext with the data from @p DC.
@@ -197,7 +198,7 @@
   ScalarEvolution &SE;
   LoopInfo &LI;
   RegionInfo &RI;
-  AliasAnalysis &AA;
+  AAResults &AA;
   //@}
 
   /// Map to remember detection contexts for all regions.
@@ -518,7 +519,7 @@
 
 public:
   ScopDetection(Function &F, const DominatorTree &DT, ScalarEvolution &SE,
-                LoopInfo &LI, RegionInfo &RI, AliasAnalysis &AA,
+                LoopInfo &LI, RegionInfo &RI, AAResults &AA,
                 OptimizationRemarkEmitter &ORE);
 
   /// Get the RegionInfo stored in this pass.
diff --git a/include/polly/ScopInfo.h b/include/polly/ScopInfo.h
index 5d18582..cdc70e0 100644
--- a/include/polly/ScopInfo.h
+++ b/include/polly/ScopInfo.h
@@ -1901,7 +1901,7 @@
   //@}
 
   /// Initialize this ScopBuilder.
-  void init(AliasAnalysis &AA, AssumptionCache &AC, DominatorTree &DT,
+  void init(AAResults &AA, AssumptionCache &AC, DominatorTree &DT,
             LoopInfo &LI);
 
   /// Add parameter constraints to @p C that imply a non-empty domain.
@@ -2737,15 +2737,15 @@
   ScopDetection &SD;
   ScalarEvolution &SE;
   LoopInfo &LI;
-  AliasAnalysis &AA;
+  AAResults &AA;
   DominatorTree &DT;
   AssumptionCache ∾
   OptimizationRemarkEmitter &ORE;
 
 public:
   ScopInfo(const DataLayout &DL, ScopDetection &SD, ScalarEvolution &SE,
-           LoopInfo &LI, AliasAnalysis &AA, DominatorTree &DT,
-           AssumptionCache &AC, OptimizationRemarkEmitter &ORE);
+           LoopInfo &LI, AAResults &AA, DominatorTree &DT, AssumptionCache &AC,
+           OptimizationRemarkEmitter &ORE);
 
   /// Get the Scop object for the given Region.
   ///