From e95ca5bb05ec123af1949469767de30036a11ecb Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Mon, 14 Nov 2022 15:08:44 +0100 Subject: [AST] Make AliasSetTracker work on BatchAA D138014 restricted AST to work on immutable IR. This means it is also safe to use a single BatchAA instance for the entire AST lifetime, instead of only batching parts of individual queries. The primary motivation for this is not compile-time, but rather having a central place to control cross-iteration AA, which will be used by D137958. Differential Revision: https://reviews.llvm.org/D137955 --- polly/include/polly/ScopDetection.h | 9 ++++----- polly/lib/Analysis/ScopBuilder.cpp | 3 ++- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'polly') diff --git a/polly/include/polly/ScopDetection.h b/polly/include/polly/ScopDetection.h index 8fe60d6..5759f75 100644 --- a/polly/include/polly/ScopDetection.h +++ b/polly/include/polly/ScopDetection.h @@ -48,22 +48,20 @@ #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" #include "llvm/Pass.h" #include -namespace llvm { -class AAResults; -} // namespace llvm - namespace polly { using llvm::AAResults; using llvm::AliasSetTracker; using llvm::AnalysisInfoMixin; using llvm::AnalysisKey; using llvm::AnalysisUsage; +using llvm::BatchAAResults; using llvm::BranchInst; using llvm::CallInst; using llvm::DenseMap; @@ -142,6 +140,7 @@ public: /// Context variables for SCoP detection. struct DetectionContext { Region &CurRegion; // The region to check. + BatchAAResults BAA; // The batched alias analysis results. AliasSetTracker AST; // The AliasSetTracker to hold the alias information. bool Verifying; // If we are in the verification phase? @@ -189,7 +188,7 @@ public: /// Initialize a DetectionContext from scratch. DetectionContext(Region &R, AAResults &AA, bool Verify) - : CurRegion(R), AST(AA), Verifying(Verify), Log(&R) {} + : CurRegion(R), BAA(AA), AST(BAA), Verifying(Verify), Log(&R) {} }; /// Helper data structure to collect statistics about loop counts. diff --git a/polly/lib/Analysis/ScopBuilder.cpp b/polly/lib/Analysis/ScopBuilder.cpp index 986e06b..ad77c4a 100644 --- a/polly/lib/Analysis/ScopBuilder.cpp +++ b/polly/lib/Analysis/ScopBuilder.cpp @@ -3205,7 +3205,8 @@ bool ScopBuilder::buildAliasChecks() { std::tuple> ScopBuilder::buildAliasGroupsForAccesses() { - AliasSetTracker AST(AA); + BatchAAResults BAA(AA); + AliasSetTracker AST(BAA); DenseMap PtrToAcc; DenseSet HasWriteAccess; -- cgit v1.1