[llvm-branch-commits] [llvm] [GVN][MemDep] Recover affine-equal select-dependent load addresses via SCEV (PR #209826)

Madhur Amilkanthwar via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Aug 10 03:36:18 PDT 2026


madhur13490 wrote:

> I'm somewhat concerned about introducing a dependency in GVN/MDA on a (powerful) tool like SCEV for quite a specific pattern, it could arguably seem a bit overkill (on top of adding a new capability to an analysis we are trying to move away from). I think I'm still not clear why canonicalizing GEPs earlier wouldn't be sufficient (at least, till ptradd would be a thing, which I think would address this entirely), or perhaps teaching PHITransAddr some basic GEP decomposition when no syntactic match is found.
> 
> Also, separately, if GVN has deleted or replaced instructions that SCEV may have cached, I believe getSCEV() calls could reference stale cache entries. This change does not appear to handle SCEV cache invalidation at all?

Ok, honestly, I was not sure too because of SCEV dependency. I have implemented what you suggested. Please have a look.

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


More information about the llvm-branch-commits mailing list