[llvm] [EarlyCSE] Compare GEP instructions based on offset (PR #65875)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 18 06:11:16 PDT 2023


nikic wrote:

> > I'm wondering, would we be able to achieve similar results if we add a `DenseMap<GetElementPtrInst *, APInt>` cache for the offset but otherwise keep the previous code structure? Or would the extra hash lookup make this slow again?
> 
> I feel like I misunderstood. Do you mean putting the GEP back into `SimpleValue`? And then create a global (or EarlyCSE only) cache value?

Yes (EarlyCSE only cache). This is just a suggestion for something to check, but I suspect the performance of that approach will not be good enough and we have to go with this version.

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


More information about the llvm-commits mailing list