OSDN Git Service

Strip metadata when speculatively hoisting instructions
authorIgor Laevsky <igmyrj@gmail.com>
Tue, 10 Nov 2015 14:10:31 +0000 (14:10 +0000)
committerIgor Laevsky <igmyrj@gmail.com>
Tue, 10 Nov 2015 14:10:31 +0000 (14:10 +0000)
commita277dc299ed5f07fafc138f91891d94904287bad
tree9d9670a5640e3a9c0f1a1ab1ec1c39777a00dbbd
parent3d0708d4a44a9064b6c5694caa985dcc46685728
Strip metadata when speculatively hoisting instructions

This is fix for PR24059.

When we are hoisting instruction above some condition it may turn out
that metadata on this instruction was control dependant on the condition.
This metadata becomes invalid and we need to drop it.

This patch should cover most obvious places of speculative execution (which
I have found by greping isSafeToSpeculativelyExecute). I think there are more
cases but at least this change covers the severe ones.

Differential Revision: http://reviews.llvm.org/D14398

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252604 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/LoopInfo.cpp
lib/Transforms/Scalar/LICM.cpp
lib/Transforms/Utils/SimplifyCFG.cpp
test/Analysis/TypeBasedAliasAnalysis/licm.ll
test/Transforms/LICM/hoist-deref-load.ll
test/Transforms/SimplifyCFG/SpeculativeExec.ll