[all-commits] [llvm/llvm-project] f96428: [MemorySSA] Don't optimize uses during construction

Nikita Popov via All-commits all-commits at lists.llvm.org
Fri Mar 18 01:56:32 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f96428e16de2181b414e39234b4d366c83cc52a8
      https://github.com/llvm/llvm-project/commit/f96428e16de2181b414e39234b4d366c83cc52a8
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2022-03-18 (Fri, 18 Mar 2022)

  Changed paths:
    M llvm/include/llvm/Analysis/MemorySSA.h
    M llvm/lib/Analysis/MemorySSA.cpp
    M llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
    M llvm/lib/Transforms/Scalar/EarlyCSE.cpp
    M llvm/lib/Transforms/Scalar/GVNHoist.cpp
    M llvm/lib/Transforms/Scalar/LICM.cpp
    M llvm/unittests/Analysis/MemorySSATest.cpp

  Log Message:
  -----------
  [MemorySSA] Don't optimize uses during construction

This changes MemorySSA to be constructed in unoptimized form.
MemorySSA::ensureOptimizedUses() can be called to optimize all
uses (once). This should be done by passes where having optimized
uses is beneficial, either because we're going to query all uses
anyway, or because we're doing def-use walks.

This should help reduce the compile-time impact of MemorySSA for
some use cases (the reason why I started looking into this is
D117926), which can avoid optimizing all uses upfront, and instead
only optimize those that are actually queried.

Actually, we have an existing use-case for this, which is EarlyCSE.
Disabling eager use optimization there gives a significant
compile-time improvement, because EarlyCSE will generally only query
clobbers for a subset of all uses (this change is not included in
this patch).

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




More information about the All-commits mailing list