[all-commits] [llvm/llvm-project] 88419a: [LICM] Allow load-only scalar promotion in the pre...

Nikita Popov via All-commits all-commits at lists.llvm.org
Tue Dec 20 01:03:02 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 88419a30a02de3a35db990399315b0b3e329627e
      https://github.com/llvm/llvm-project/commit/88419a30a02de3a35db990399315b0b3e329627e
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2022-12-20 (Tue, 20 Dec 2022)

  Changed paths:
    M llvm/include/llvm/Analysis/AliasSetTracker.h
    M llvm/include/llvm/Transforms/Utils/LoopUtils.h
    M llvm/lib/Analysis/AliasSetTracker.cpp
    M llvm/lib/Transforms/Scalar/LICM.cpp
    M llvm/lib/Transforms/Scalar/LoopRerollPass.cpp
    M llvm/test/Transforms/LICM/guards.ll
    M llvm/test/Transforms/LICM/invariant.start.ll
    M llvm/test/Transforms/LICM/promote-unknown-load.ll
    M llvm/test/Transforms/LoopVectorize/invariant-store-vectorization.ll
    M llvm/unittests/Analysis/AliasSetTrackerTest.cpp

  Log Message:
  -----------
  [LICM] Allow load-only scalar promotion in the presence of aliasing loads

During scalar promotion, if there are additional potentially-aliasing
loads outside the promoted set, we can still perform a load-only
promotion. As the stores are retained, any potentially-aliasing
loads will still read the correct value.

This increases the number of load promotions in llvm-test-suite by
a factor of two:

                                |  Old |  New
    licm.NumPromotionCandidates | 4448 | 6038
    licm.NumLoadPromoted        |  479 | 1069
    licm.NumLoadStorePromoted   | 1459 | 1459

Unfortunately, this does have some impact on compile-time:
http://llvm-compile-time-tracker.com/compare.php?from=57f7f0d6cf0706a88e1ecb74f3d3e8891cceabfa&to=72b811738148aab399966a0435f13b695da1c1c8&stat=instructions
In part this is because we now have less early bailouts from
promotion, but also due to second order effects (e.g. for one case
I looked at we spend more time in SLP now).

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




More information about the All-commits mailing list