[llvm] Add a pass "SinkGEPConstOffset" (PR #140657)

via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 12 17:21:02 PDT 2025


StevenYangCC wrote:

> I think #143470 might be implementing the same thing in SeparateConstOffsetFromGEP?

I don't think the two patches function in exactly the same way. That patch just merges the const in the base part of the GEP expression. But this patch presupposes that base is a GEP, and by implication, presupposes that it's a strict GEP chain, and the function is to sink the const offset down the GEP chain to the end. The two are oriented to different patterns.

Can you please REVIEW this PATCH by the way? @nikic 

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


More information about the llvm-commits mailing list