[all-commits] [llvm/llvm-project] 7553ba: [LICM] Don't require optimized uses

Nikita Popov via All-commits all-commits at lists.llvm.org
Wed Apr 5 02:20:43 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7553bad1ac619d5de72489ec06b63a2ace356c22
      https://github.com/llvm/llvm-project/commit/7553bad1ac619d5de72489ec06b63a2ace356c22
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2023-04-05 (Wed, 05 Apr 2023)

  Changed paths:
    M llvm/lib/Transforms/Scalar/LICM.cpp
    M llvm/test/Analysis/MemorySSA/pr43427.ll
    M llvm/test/Analysis/MemorySSA/pr45927.ll
    M llvm/test/Analysis/MemorySSA/pr49859.ll

  Log Message:
  -----------
  [LICM] Don't require optimized uses

LICM currently requests optimized use MSSA form. This is wasteful,
because LICM doesn't actually care about most uses, only those of
invariant pointers in loops. Everything else doesn't need to be
optimized.

LICM already uses the clobber walker in most places. This patch
adjusts one place that was using getDefiningAccess() to use it as
well, so we no longer have a dependence on pre-optimized uses.

This change is not NFC in that the fallback on the defining access
when there are too many clobber calls may now fall back to an
unoptimized use. In practice, I've not seen any problems with this
though. If desired, we could also increase licm-mssa-optimization-cap
to a higher value (increasing this from 100 to 200 has no impact on
average compile-time -- but also doesn't appear to have any impact
on LICM quality either).

This makes for a 0.9% geomean compile-time improvement on CTMark.

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




More information about the All-commits mailing list