diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index 11f6937a8ee..67b99c56e7e 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -2624,8 +2624,7 @@ Instruction *InstCombiner::visitGetElementPtrInst(GetElementPtrInst &GEP) { bool EndsWithSequential = false; for (gep_type_iterator I = gep_type_begin(*cast(PtrOp)), E = gep_type_end(*cast(PtrOp)); I != E; ++I) - if (!isa(*I)) - EndsWithSequential = true; + EndsWithSequential = !isa(*I); // Can we combine the two pointer arithmetics offsets? if (EndsWithSequential) {