]> granicus.if.org Git - llvm/commit
[LICM] Allow promotion of some stores that are not guaranteed to execute.
authorMichael Kuperstein <mkuper@google.com>
Thu, 5 Jan 2017 20:42:06 +0000 (20:42 +0000)
committerMichael Kuperstein <mkuper@google.com>
Thu, 5 Jan 2017 20:42:06 +0000 (20:42 +0000)
commit82d65fbb4680c4beeb6a64342cc6dc730009b079
treec7b74da9dd9d36d1b295fec2b74c7240d6db896a
parent4700463eb14e91dd8c370fa354ac315b77a9bb6a
[LICM] Allow promotion of some stores that are not guaranteed to execute.

Promotion is always legal when a store within the loop is guaranteed to execute.

However, this is not a necessary condition - for promotion to be memory model
semantics-preserving, it is enough to have a store that dominates every exit
block. This is because if the store dominates every exit block, the fact the
exit block was executed implies the original store was executed as well.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291171 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/LICM.cpp
test/Transforms/LICM/scalar_promote.ll