summaryrefslogtreecommitdiff
path: root/polly
diff options
context:
space:
mode:
authorNikita Popov <npopov@redhat.com>2022-11-14 15:08:44 +0100
committerNikita Popov <npopov@redhat.com>2022-12-05 08:12:26 +0100
commite95ca5bb05ec123af1949469767de30036a11ecb (patch)
tree41d47aa05b82b3a4e7a09d96512647b37923d35a /polly
parent75801e3b45565d7d14ef6ead2132dc06fc009941 (diff)
downloadllvm-e95ca5bb05ec123af1949469767de30036a11ecb.tar.gz
[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
Diffstat (limited to 'polly')
-rw-r--r--polly/include/polly/ScopDetection.h9
-rw-r--r--polly/lib/Analysis/ScopBuilder.cpp3
2 files changed, 6 insertions, 6 deletions
diff --git a/polly/include/polly/ScopDetection.h b/polly/include/polly/ScopDetection.h
index 8fe60d6c50a1..5759f7546328 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 <set>
-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 986e06b459f2..ad77c4a53038 100644
--- a/polly/lib/Analysis/ScopBuilder.cpp
+++ b/polly/lib/Analysis/ScopBuilder.cpp
@@ -3205,7 +3205,8 @@ bool ScopBuilder::buildAliasChecks() {
std::tuple<ScopBuilder::AliasGroupVectorTy, DenseSet<const ScopArrayInfo *>>
ScopBuilder::buildAliasGroupsForAccesses() {
- AliasSetTracker AST(AA);
+ BatchAAResults BAA(AA);
+ AliasSetTracker AST(BAA);
DenseMap<Value *, MemoryAccess *> PtrToAcc;
DenseSet<const ScopArrayInfo *> HasWriteAccess;