OSDN Git Service

[LICM] Reapply r347190 "Make LICM able to hoist phis" with fix
authorJohn Brawn <john.brawn@arm.com>
Wed, 28 Nov 2018 17:21:49 +0000 (17:21 +0000)
committerJohn Brawn <john.brawn@arm.com>
Wed, 28 Nov 2018 17:21:49 +0000 (17:21 +0000)
commit3f74a7bddb37f5ffb9d46dca3dd38e38197fab38
tree05f5f84f73705078004b09fc7610353b09d59002
parent5f68f0ae94a5e3e699225b2344ce96cad85c256d
[LICM] Reapply r347190 "Make LICM able to hoist phis" with fix

This commit caused failures because it failed to correctly handle cases where
we hoist a phi, then hoist a use of that phi, then have to rehoist that use. We
need to make sure that we rehoist the use to _after_ the hoisted phi, which we
do by always rehoisting to the immediate dominator instead of just rehoisting
everything to the original preheader.

An option is also added to control whether control flow is hoisted, which is
off in this commit but will be turned on in a subsequent commit.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@347776 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/LICM.cpp
test/Transforms/LICM/hoist-phi.ll [new file with mode: 0644]