[PATCH] D28147: [LICM] Allow promotion of some stores that are not guaranteed to execute

Michael Kuperstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 28 16:24:16 PST 2016


mkuper created this revision.
mkuper added reviewers: reames, eli.friedman, danielcdh.
mkuper added a subscriber: llvm-commits.

The basic idea is that we can promote even if the store is not guaranteed to execute - if the conditions under which it doesn't executes mean the exit blocks won't execute either. Specifically, if something in the loop can throw before reaching the store, that shouldn't block the promotion.
Does this make sense, or am I missing something about the semantics?

The patch also includes a refactoring which was prompted by the fact we now need the exit blocks earlier. I can "unbundle" it, but I'm not entirely sure it makes sense without this patch. Let me know what you prefer.


https://reviews.llvm.org/D28147

Files:
  lib/Transforms/Scalar/LICM.cpp
  test/Transforms/LICM/scalar_promote.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28147.82627.patch
Type: text/x-patch
Size: 11412 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161229/6b12d9f9/attachment.bin>


More information about the llvm-commits mailing list