OSDN Git Service

[LoopSimplify] Use BB::instructionsWithoutDebug to skip DbgInfo (NFC).
authorFlorian Hahn <florian.hahn@arm.com>
Mon, 30 Apr 2018 19:19:36 +0000 (19:19 +0000)
committerFlorian Hahn <florian.hahn@arm.com>
Mon, 30 Apr 2018 19:19:36 +0000 (19:19 +0000)
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331217 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Utils/LoopSimplify.cpp

index 1ee2141..bc5d6a9 100644 (file)
@@ -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<DbgInfoIntrinsic>(Inst))
-          continue;
         if (Inst == CI)
           continue;
         if (!L->makeLoopInvariant(Inst, AnyInvariant,