X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=blobdiff_plain;f=lib%2FAnalysis%2FLoopInfo.cpp;fp=lib%2FAnalysis%2FLoopInfo.cpp;h=e679b7ad7b86a17987ef0743e62e3670f9cf074f;hp=9ee72361c92a6bf9582f0edd27666d187b1c6566;hb=a90859a6e3751e2289c44b57723658bf8962dcc5;hpb=66b8eaaca4e94447e3be9639cf2c0baf3f0163b2 diff --git a/lib/Analysis/LoopInfo.cpp b/lib/Analysis/LoopInfo.cpp index 9ee72361c92..e679b7ad7b8 100644 --- a/lib/Analysis/LoopInfo.cpp +++ b/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; }