[PATCH] D133111: [LICM] Allow load-only scalar promotion in the presence of unwinding

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 1 07:18:29 PDT 2022


nikic created this revision.
nikic added reviewers: fhahn, asbirlea, efriedma, reames.
Herald added a subscriber: hiraditya.
Herald added a project: All.
nikic requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Currently, we bail out of scalar promotion if the loop may unwind and the memory may be visible on unwind. This is because we can't insert stores of the promoted value on unwind edges.

However, nowadays scalar promotion also has support for only promoting loads, while leaving stores in place. This kind of promotion is safe even in the presence of unwinding.

(The next and more interesting step is that we can also allow potentially aliasing reads of the pointer when doing load-only promotion.)


https://reviews.llvm.org/D133111

Files:
  llvm/lib/Transforms/Scalar/LICM.cpp
  llvm/test/Transforms/LICM/guards.ll
  llvm/test/Transforms/LICM/scalar-promote-unwind.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D133111.457266.patch
Type: text/x-patch
Size: 9044 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220901/9e1a8e88/attachment.bin>


More information about the llvm-commits mailing list