[all-commits] [llvm/llvm-project] f3e871: [GlobalOpt] Support "stored once" optimization for...

Nikita Popov via All-commits all-commits at lists.llvm.org
Wed Jan 12 00:39:46 PST 2022


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

  Changed paths:
    M llvm/lib/Transforms/IPO/GlobalOpt.cpp
    A llvm/test/Transforms/GlobalOpt/stored-once-different-type.ll
    M llvm/test/Transforms/GlobalOpt/stored-once-value-type.ll

  Log Message:
  -----------
  [GlobalOpt] Support "stored once" optimization for different types

GlobalOpt can optimize a global with undef initializer and a single
store to put the stored value into the initializer instead. Currently,
this requires the type of the global and the store to match.

This patch extends support to cases with different types (but same
size), in which case we create a new global to replace the old one.

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




More information about the All-commits mailing list