[LICM] Avoind store sinking if no preheader is available
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>
Tue, 2 Dec 2014 14:22:34 +0000 (14:22 +0000)
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>
Tue, 2 Dec 2014 14:22:34 +0000 (14:22 +0000)
commit8fc3ffbb74b4844a15e476c1afaf99908361dca4
tree26acd2a512dadccf60173a0abf7dc5a35fe5bee4
parentbd3e0681451fcba51a18520b2c8e249cb24bf37b
[LICM] Avoind store sinking if no preheader is available

Load instructions are inserted into loop preheaders when sinking stores
and later removed if not used by the SSA updater. Avoid sinking if the
loop has no preheader and avoid crashes. This fixes one more side effect
of not handling indirectbr instructions properly on LoopSimplify.

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