Skip to content

Commit d977b4a

Browse files
committed
[Polly] Use SmallDenseMap for MapInsnToMemAcc for better performance
Change MapInsnToMemAcc from std::map to SmallDenseMap<..., 16> for improved compile time. This is consistent with the SmallDenseMap optimizations made in DependenceAnalysis. Note: Polly already has batch delinearization built into its architecture - it collects all accesses in DetectionContext.Accesses, then processes them together in getDelinearizationTerms() and hasBaseAffineAccesses(). This was the model for the batch delinearization changes in DependenceAnalysis.
1 parent a11356d commit d977b4a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

polly/include/polly/ScopDetection.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848

4949
#include "polly/ScopDetectionDiagnostic.h"
5050
#include "polly/Support/ScopHelper.h"
51+
#include "llvm/ADT/DenseMap.h"
5152
#include "llvm/Analysis/AliasAnalysis.h"
5253
#include "llvm/Analysis/AliasSetTracker.h"
5354
#include "llvm/Analysis/RegionInfo.h"
@@ -77,6 +78,7 @@ using llvm::RegionInfo;
7778
using llvm::ScalarEvolution;
7879
using llvm::SCEVUnknown;
7980
using llvm::SetVector;
81+
using llvm::SmallDenseMap;
8082
using llvm::SmallSetVector;
8183
using llvm::SmallVectorImpl;
8284
using llvm::StringRef;
@@ -108,7 +110,7 @@ struct MemAcc {
108110
: Insn(I), Shape(S) {}
109111
};
110112

111-
using MapInsnToMemAcc = std::map<const Instruction *, MemAcc>;
113+
using MapInsnToMemAcc = SmallDenseMap<const Instruction *, MemAcc, 16>;
112114
using PairInstSCEV = std::pair<const Instruction *, const SCEV *>;
113115
using AFs = std::vector<PairInstSCEV>;
114116
using BaseToAFs = std::map<const SCEVUnknown *, AFs>;

0 commit comments

Comments
 (0)