diff options
Diffstat (limited to 'lib/Transforms/Scalar/LoopUnswitch.cpp')
-rw-r--r-- | lib/Transforms/Scalar/LoopUnswitch.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/Transforms/Scalar/LoopUnswitch.cpp b/lib/Transforms/Scalar/LoopUnswitch.cpp index f5061b5..daf1841 100644 --- a/lib/Transforms/Scalar/LoopUnswitch.cpp +++ b/lib/Transforms/Scalar/LoopUnswitch.cpp @@ -168,13 +168,10 @@ static Value *FindLIVLoopCondition(Value *Cond, Loop *L, bool &Changed) { if (isa<Constant>(Cond)) return 0; // TODO: Handle: br (VARIANT|INVARIANT). - if (L->isLoopInvariant(Cond)) return Cond; // Hoist simple values out. - if (L->makeLoopInvariant(Cond)) { - Changed = true; + if (L->makeLoopInvariant(Cond, Changed)) return Cond; - } if (BinaryOperator *BO = dyn_cast<BinaryOperator>(Cond)) if (BO->getOpcode() == Instruction::And || |