From 8fe04ad3f7acf9eac603602cfc2980b7ad85d7a1 Mon Sep 17 00:00:00 2001 From: Florian Hahn Date: Mon, 30 Apr 2018 19:19:36 +0000 Subject: [LoopSimplify] Use BB::instructionsWithoutDebug to skip DbgInfo (NFC). This patch updates some code responsible the skip debug info to use BasicBlock::instructionsWithoutDebug. I think this makes things slightly simpler and more direct. Reviewers: aprantl, vsk, chandlerc Reviewed By: aprantl Differential Revision: https://reviews.llvm.org/D46253 llvm-svn: 331217 --- llvm/lib/Transforms/Utils/LoopSimplify.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'llvm/lib/Transforms/Utils/LoopSimplify.cpp') diff --git a/llvm/lib/Transforms/Utils/LoopSimplify.cpp b/llvm/lib/Transforms/Utils/LoopSimplify.cpp index 1ee21411377..bc5d6a9b54e 100644 --- a/llvm/lib/Transforms/Utils/LoopSimplify.cpp +++ b/llvm/lib/Transforms/Utils/LoopSimplify.cpp @@ -613,11 +613,8 @@ ReprocessLoop: // comparison and the branch. bool AllInvariant = true; bool AnyInvariant = false; - for (BasicBlock::iterator I = ExitingBlock->begin(); &*I != BI; ) { + for (auto I = ExitingBlock->instructionsWithoutDebug().begin(); &*I != BI; ) { Instruction *Inst = &*I++; - // Skip debug info intrinsics. - if (isa(Inst)) - continue; if (Inst == CI) continue; if (!L->makeLoopInvariant(Inst, AnyInvariant, -- cgit v1.2.3