aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/LoopInfo.cpp
diff options
context:
space:
mode:
authorIgor Laevsky <igmyrj@gmail.com>2015-11-18 14:50:18 +0000
committerIgor Laevsky <igmyrj@gmail.com>2015-11-18 14:50:18 +0000
commit7310c68e857b8f9f3094695775d7ce3a7708cfe5 (patch)
tree34587de514edc2be886c05f9a9c603e55a82a1ae /llvm/lib/Analysis/LoopInfo.cpp
parent27e67986afb401d8d120c6aa5d69f053a430311f (diff)
downloadllvm-7310c68e857b8f9f3094695775d7ce3a7708cfe5.zip
llvm-7310c68e857b8f9f3094695775d7ce3a7708cfe5.tar.gz
llvm-7310c68e857b8f9f3094695775d7ce3a7708cfe5.tar.bz2
Revert "Revert "Strip metadata when speculatively hoisting instructions (r252604)"
Failing clang test is now fixed by the r253458. llvm-svn: 253459
Diffstat (limited to 'llvm/lib/Analysis/LoopInfo.cpp')
-rw-r--r--llvm/lib/Analysis/LoopInfo.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/LoopInfo.cpp b/llvm/lib/Analysis/LoopInfo.cpp
index 9ee7236..e679b7a 100644
--- a/llvm/lib/Analysis/LoopInfo.cpp
+++ b/llvm/lib/Analysis/LoopInfo.cpp
@@ -120,6 +120,13 @@ bool Loop::makeLoopInvariant(Instruction *I, bool &Changed,
// Hoist.
I->moveBefore(InsertPt);
+
+ // There is possibility of hoisting this instruction above some arbitrary
+ // condition. Any metadata defined on it can be control dependent on this
+ // condition. Conservatively strip it here so that we don't give any wrong
+ // information to the optimizer.
+ I->dropUnknownNonDebugMetadata();
+
Changed = true;
return true;
}