[PATCH] D71993: [Transforms][GlobalSRA] huge array causes long compilation time and huge memory usage.
Reid Kleckner via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 30 11:28:39 PST 2019
rnk added a comment.
I think, in this case, we should fix the underlying problem. The pass already works like this:
- check that all uses of GV are constant, inbounds GEPs
- make new globals for each element in GV
- re-iterate uses of GV, assert that each is a constant inbounds element access, replace access with new global for that index
We could make this more efficient by recording which elements are used during the initial safety check, and only making new globals for those. A bitvector indexed by element index, for example, would do the trick. This would allow us to, for your test case, delete all elements other than element 0, without excessive memory usage.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D71993/new/
https://reviews.llvm.org/D71993
More information about the llvm-commits
mailing list