[GVN/PRE] Hoist global values outside of loops.
authorDavide Italiano <davide@freebsd.org>
Sat, 15 Oct 2016 21:35:23 +0000 (21:35 +0000)
committerDavide Italiano <davide@freebsd.org>
Sat, 15 Oct 2016 21:35:23 +0000 (21:35 +0000)
commit590ad7037e534bd0a9a52e91391bd35ec5834b06
tree1fbe327d6f1de0d57eafcb5244b8525404a71a24
parentbbcfec7edd010aeb2f86780b7491a400dbe0f5d9
[GVN/PRE] Hoist global values outside of loops.

In theory this could be generalized to move anything where
we prove the operands are available, but that would require
rewriting PRE. As NewGVN will hopefully come soon, and we're
trying to rewrite PRE in terms of NewGVN+MemorySSA, it's probably
not worth spending too much time on it. Fix provided by
Daniel Berlin!

llvm-svn: 284311
llvm/lib/Transforms/Scalar/GVN.cpp
llvm/test/Transforms/GVN/PRE/hoist-loads.ll [new file with mode: 0644]
llvm/test/Transforms/GVN/PRE/pre-single-pred.ll