[llvm] [LoadStoreVectorizer] Postprocess and merge equivalence classes (PR #114501)
Vyacheslav Klochkov via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 27 19:42:33 PDT 2025
v-klochkov wrote:
> I'm somewhat confused by this change. Why add this kind of complex post-processing step instead of increasing the getUnderlyingObject() limits?
>
> In fact, I did raise it from 6 to 10 recently (#143714). Is it possible that this functionality is now no longer needed?
>
> Edit: Oh, I guess just raising the limit is not quite the same, because it does not handle an arbitrarily sized "ladder". Though I'm still somewhat confused how you would end up with this kind of long constant offset gep chain without something being wrong somewhere else.
@nikic - In fact it was not one extra-long chain of const offset GEPs, but a mix of const and non-const offset GEPs, some/many with 2+ uses.
Increasing the depth from 6 to 10 could help to the particular workload that I optimized, but it would be right on the edge and fragile, e.g. it is a big risk of breaking vectorization if something changes or the vector becomes longer.
The merge_sequences routine only looked for depth-1 and had couple early exits to avoid unnecessary work.
https://github.com/llvm/llvm-project/pull/114501
More information about the llvm-commits
mailing list