Skip to content

Commit a11356d

Browse files
committed
use SmallDenseMap in DelinearizationCache for better compile time
1 parent 546777f commit a11356d

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

llvm/include/llvm/Analysis/DependenceAnalysis.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -402,11 +402,13 @@ class DependenceInfo {
402402
/// leading to better precision (similar to Polly's approach).
403403
struct DelinearizationCache {
404404
/// Map from base pointer to computed array dimension sizes.
405-
DenseMap<const SCEVUnknown *, SmallVector<const SCEV *, 4>> ArraySizes;
405+
SmallDenseMap<const SCEVUnknown *, SmallVector<const SCEV *, 4>, 8>
406+
ArraySizes;
406407
/// Map from instruction to pre-computed subscripts.
407-
DenseMap<const Instruction *, SmallVector<const SCEV *, 4>> Subscripts;
408+
SmallDenseMap<const Instruction *, SmallVector<const SCEV *, 4>, 16>
409+
Subscripts;
408410
/// Element size for the array (used for validation).
409-
DenseMap<const SCEVUnknown *, const SCEV *> ElementSizes;
411+
SmallDenseMap<const SCEVUnknown *, const SCEV *, 8> ElementSizes;
410412
/// Flag indicating whether the cache has been populated.
411413
bool IsPopulated = false;
412414
};

llvm/lib/Analysis/DependenceAnalysis.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3783,8 +3783,8 @@ void DependenceInfo::populateDelinearizationCache() {
37833783

37843784
// Step 1: Collect all memory accesses grouped by base pointer.
37853785
// Map from base pointer to list of (Instruction, AccessFunction) pairs.
3786-
DenseMap<const SCEVUnknown *,
3787-
SmallVector<std::pair<Instruction *, const SCEV *>, 4>>
3786+
SmallDenseMap<const SCEVUnknown *,
3787+
SmallVector<std::pair<Instruction *, const SCEV *>, 4>, 8>
37883788
AccessesByBase;
37893789

37903790
for (Instruction &I : instructions(*F)) {

0 commit comments

Comments
 (0)