[llvm] [InstCombine] Make foldCmpLoadFromIndexedGlobal more resiliant to non-array geps. (PR #150639)

David Green via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 31 06:32:27 PDT 2025


davemgreen wrote:

I should explain where this comes from, as there are a number of related issues going on at the same time. It was from a report I had of this code behaving differently between func1 and func2, just because of the different types of the GEP. One pulls an add out of the loop with rbit+ctz in it, the other doesn't. There are probably several ways to look at addressing that, but I figured the structs can be removed from the geps and that gets us closer to where we want to be.
https://godbolt.org/z/6dsK4zWhd

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


More information about the llvm-commits mailing list