1 Commits

Author SHA1 Message Date
Sebastian Pop
21af1c9019 GVN-hoist: fix hoistingFromAllPaths for loops (PR29034)
It is invalid to hoist stores or loads if they are not executed on all paths
from the hoisting point to the exit of the function. In the testcase, there are
paths in the loop that do not execute the stores or the loads, and so hoisting
them within the loop is unsafe.

The problem is that the current implementation of hoistingFromAllPaths is
incomplete: it walks all blocks dominated by the hoisting point, and does not
return false when the loop contains a path on which the hoisted ld/st is
not executed.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279732 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-25 11:55:47 +00:00