[all-commits] [llvm/llvm-project] 4796b4: [GlobalOpt] Make global SRA offset based

Nikita Popov via All-commits all-commits at lists.llvm.org
Mon Jan 17 00:28:51 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4796b4ae7bccc7b75a26b666fbd554c49b274404
      https://github.com/llvm/llvm-project/commit/4796b4ae7bccc7b75a26b666fbd554c49b274404
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2022-01-17 (Mon, 17 Jan 2022)

  Changed paths:
    M llvm/lib/Transforms/IPO/GlobalOpt.cpp
    M llvm/test/DebugInfo/Generic/global-sra-array.ll
    M llvm/test/Transforms/GlobalOpt/externally-initialized-global-ctr.ll
    M llvm/test/Transforms/GlobalOpt/globalsra-align.ll
    M llvm/test/Transforms/GlobalOpt/globalsra-generic-type.ll
    A llvm/test/Transforms/GlobalOpt/globalsra-opaque-ptr.ll
    A llvm/test/Transforms/GlobalOpt/globalsra-recursive.ll

  Log Message:
  -----------
  [GlobalOpt] Make global SRA offset based

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.

Differential Revision: https://reviews.llvm.org/D117223




More information about the All-commits mailing list