[llvm] [InterleavedLoadCombine] Index candidates to avoid quadratic matching (PR #213053)

Madhur Amilkanthwar via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 12 03:57:52 PDT 2026


================
@@ -1282,18 +1270,60 @@ bool InterleavedLoadCombineImpl::run() {
       }
     }
 
-    std::list<VectorInfo> InterleavedLoad;
-    while (findPattern(Candidates, InterleavedLoad, Factor, DL)) {
-      if (combine(InterleavedLoad, ORE)) {
+    // Index every candidate whose first element has a provably exact offset by
+    // its address key. Finding an interleaved group then only needs lookups of
+    // the neighbouring keys. The key embeds a Polynomial, which has no natural
+    // empty/tombstone value, so use std::unordered_map rather than DenseMap.
+    std::unordered_map<OffsetKey, SmallVector<VectorInfo *, 1>, OffsetKeyHash>
----------------
madhur13490 wrote:

I am doing hashing here and the working set is function-wide not BB-wide. 

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


More information about the llvm-commits mailing list