Add Loop contains utility methods for testing whether a loop
[oota-llvm.git] / lib / Transforms / Scalar / IndVarSimplify.cpp
index 2912421e704bba41615d2f2d8fe0fdeeb833b694..3aa4fd32348aa641115b302eac3918526d51148d 100644 (file)
@@ -258,7 +258,7 @@ void IndVarSimplify::RewriteLoopExitValues(Loop *L,
 
         // Check that InVal is defined in the loop.
         Instruction *Inst = cast<Instruction>(InVal);
-        if (!L->contains(Inst->getParent()))
+        if (!L->contains(Inst))
           continue;
 
         // Okay, this instruction has a user outside of the current loop