[PATCH] D46253: [LoopSimplify] Use BB::instructionsWithoutDebug to skip DbgInfo (NFC).

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 30 02:10:48 PDT 2018


fhahn created this revision.
fhahn added reviewers: aprantl, vsk, chandlerc.
fhahn added a project: debug-info.
Herald added a subscriber: JDevlieghere.

This patch updates some code responsible the skip debug info to use
BasicBlock::instructionsWithoutDebug. I think this makes things slightly
simpler and more direct.


https://reviews.llvm.org/D46253

Files:
  lib/Transforms/Utils/LoopSimplify.cpp


Index: lib/Transforms/Utils/LoopSimplify.cpp
===================================================================
--- lib/Transforms/Utils/LoopSimplify.cpp
+++ lib/Transforms/Utils/LoopSimplify.cpp
@@ -613,11 +613,8 @@
       // 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,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46253.144518.patch
Type: text/x-patch
Size: 723 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180430/44e7e1a1/attachment.bin>


More information about the llvm-commits mailing list