[llvm] [DA] Cache delinearization results. NFCI. (PR #164379)

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 21 04:02:15 PDT 2025


================
@@ -420,6 +420,12 @@ class DependenceInfo {
   Function *F;
   SmallVector<const SCEVPredicate *, 4> Assumptions;
 
+  /// Cache for delinearized subscripts to avoid recomputation.
+  /// Maps (Instruction, Loop, AccessFn) -> Subscripts
+  DenseMap<std::tuple<Instruction *, Loop *, const SCEV *>,
+           SmallVector<const SCEV *, 4>>
----------------
Meinersbur wrote:

```suggestion
           SmallVector<const SCEV *, 1>>
```
Consider a smaller SmallVector, maybe even `SmallVector<const SCEV *, 0>`. `DenseMap` only uses a fraction of its entries, big item and key objects waste a lot of space.

https://github.com/llvm/llvm-project/pull/164379


More information about the llvm-commits mailing list