[PATCH] D129525: [GlobalOpt] Drop SRA split limit for struct types.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 13 12:44:33 PDT 2022


fhahn added a comment.



In D129525#3649361 <https://reviews.llvm.org/D129525#3649361>, @nikic wrote:

> @fhahn I think your last update is missing the code changes :)

I didn't make any code changes to the original version and it looks like the original code change is still there. Am I missing something? :)

> I assume that you don't actually care about SRA as such, but rather about some follow-on transforms it enables. I've been thinking that we might want to make GlobalOpt in general work on the SRAd representation internally, which might remove the need to actually materialize it in some cases. So if some parts of the global are never written, it will certainly always be profitable to replace them with (part of) the initializer, regardless of how many parts there are. The limit is only relevant for cases where we actually do leave behind the globals. Do you know which optimization in particular is important for your workload?

Yeah, ideally SRA would not materialize each transform it applies straight away, e.g. for the test cases the split up globals will get removed after materializing them.

I think the main regression comes from SRA not removing stores of function pointers that are never read, which in turn prevents LLVM from removing those functions.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D129525/new/

https://reviews.llvm.org/D129525



More information about the llvm-commits mailing list