[PATCH] D53091: [LV] Ignore more debug info.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 10 10:15:19 PDT 2018


fhahn created this revision.
fhahn added reviewers: rengolin, hsaito, dcaballe, aprantl, vsk.
Herald added subscribers: rkruppe, JDevlieghere.

We can avoid doing some unnecessary work by skipping debug instructions
in a few loops. It also helps to ensure debug instructions do not
prevent vectorization, although I do not have any concrete test cases
for that.


https://reviews.llvm.org/D53091

Files:
  lib/Transforms/Vectorize/LoopVectorize.cpp


Index: lib/Transforms/Vectorize/LoopVectorize.cpp
===================================================================
--- lib/Transforms/Vectorize/LoopVectorize.cpp
+++ lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -4655,7 +4655,7 @@
   // For each block.
   for (BasicBlock *BB : TheLoop->blocks()) {
     // For each instruction in the loop.
-    for (Instruction &I : *BB) {
+    for (Instruction &I : BB->instructionsWithoutDebug()) {
       Type *T = I.getType();
 
       // Skip ignored values.
@@ -4893,7 +4893,7 @@
 
   unsigned Index = 0;
   for (BasicBlock *BB : make_range(DFS.beginRPO(), DFS.endRPO())) {
-    for (Instruction &I : *BB) {
+    for (Instruction &I : BB->instructionsWithoutDebug()) {
       IdxToInstr[Index++] = &I;
 
       // Save the end location of each USE.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53091.169034.patch
Type: text/x-patch
Size: 793 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181010/1e3ff969/attachment.bin>


More information about the llvm-commits mailing list