diff options
author | Igor Laevsky <igmyrj@gmail.com> | 2015-11-18 14:50:18 +0000 |
---|---|---|
committer | Igor Laevsky <igmyrj@gmail.com> | 2015-11-18 14:50:18 +0000 |
commit | 7310c68e857b8f9f3094695775d7ce3a7708cfe5 (patch) | |
tree | 34587de514edc2be886c05f9a9c603e55a82a1ae /llvm/lib/Analysis/LoopInfo.cpp | |
parent | 27e67986afb401d8d120c6aa5d69f053a430311f (diff) | |
download | llvm-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.cpp | 7 |
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; } |