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

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 2 02:44:43 PDT 2022


nikic created this revision.
nikic added reviewers: reames, djtodoro, fhahn, asbirlea, efriedma.
Herald added subscribers: jeroen.dobbelaere, hiraditya.
Herald added a project: All.
nikic requested review of this revision.
Herald added subscribers: llvm-commits, pcwang-thead.
Herald added a project: LLVM.

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.

Unfortunately, this does have some impact on compile-time: http://llvm-compile-time-tracker.com/compare.php?from=c453e5b901ccaf9e7102575d6b14f190acc703be&to=87314a5160669d1ca574c280cf3521c066ac1a0e&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).


https://reviews.llvm.org/D133192

Files:
  llvm/include/llvm/Analysis/AliasSetTracker.h
  llvm/include/llvm/Transforms/Utils/LoopUtils.h
  llvm/lib/Analysis/AliasSetTracker.cpp
  llvm/lib/Transforms/Scalar/LICM.cpp
  llvm/lib/Transforms/Scalar/LoopRerollPass.cpp
  llvm/test/Transforms/LICM/guards.ll
  llvm/test/Transforms/LICM/promote-unknown-load.ll
  llvm/test/Transforms/LoopVectorize/invariant-store-vectorization.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D133192.457539.patch
Type: text/x-patch
Size: 20670 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220902/6124469a/attachment.bin>


More information about the llvm-commits mailing list