[PATCH] D117223: [GlobalOpt] Make global SRA offset based

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 13 06:12:35 PST 2022


nikic created this revision.
nikic added a reviewer: opaque-pointers.
Herald added subscribers: ormris, hiraditya.
nikic requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Currently global SRA uses the GEP structure to determine how to split the global. This patch instead analyses the loads and stores that are performed on the global, and collects which types are used at which offset, and then splits the global according to those.

This is both more general, and works fine with opaque pointers. This is also closer to how ordinary SROA is performed.


https://reviews.llvm.org/D117223

Files:
  llvm/lib/Transforms/IPO/GlobalOpt.cpp
  llvm/test/Transforms/GlobalOpt/externally-initialized-global-ctr.ll
  llvm/test/Transforms/GlobalOpt/globalsra-align.ll
  llvm/test/Transforms/GlobalOpt/globalsra-opaque-ptr.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D117223.399645.patch
Type: text/x-patch
Size: 22856 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220113/70871d0e/attachment.bin>


More information about the llvm-commits mailing list