a pointer value out of a loop causing it to be duplicated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20828
91177308-0d34-0410-b5e6-
96231b3b80d8
// outside of the loop. In this case, it doesn't even matter if the
// operands of the instruction are loop invariant.
//
- if (canSinkOrHoistInst(I) && isNotUsedInLoop(I)) {
+ if (isNotUsedInLoop(I) && canSinkOrHoistInst(I)) {
++II;
sink(I);
}
New = &I;
} else {
New = I.clone();
+ CurAST->copyValue(&I, New);
if (!I.getName().empty())
New->setName(I.getName()+".le");
ExitBlock->getInstList().insert(InsertPt, New);