[llvm] r344232 - [LV] Ignore more debug info.

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 11 02:27:24 PDT 2018


Author: fhahn
Date: Thu Oct 11 02:27:24 2018
New Revision: 344232

URL: http://llvm.org/viewvc/llvm-project?rev=344232&view=rev
Log:
[LV] Ignore more debug info.

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.

Reviewers: rengolin, hsaito, dcaballe, aprantl, vsk

Reviewed By: rengolin, dcaballe

Differential Revision: https://reviews.llvm.org/D53091

Modified:
    llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp

Modified: llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp?rev=344232&r1=344231&r2=344232&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp (original)
+++ llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp Thu Oct 11 02:27:24 2018
@@ -4655,7 +4655,7 @@ LoopVectorizationCostModel::getSmallestA
   // 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 @@ LoopVectorizationCostModel::calculateReg
 
   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.




More information about the llvm-commits mailing list