diff options
author | Florian Hahn <florian.hahn@arm.com> | 2018-10-11 09:27:24 +0000 |
---|---|---|
committer | Florian Hahn <florian.hahn@arm.com> | 2018-10-11 09:27:24 +0000 |
commit | 7eb5cb4ebc69b8b6d995287a68dac01004f79d15 (patch) | |
tree | 02e650440e90bc5dff4d365aa619f0a227c2c5fe /llvm/lib/Transforms/Vectorize/LoopVectorize.cpp | |
parent | d32c0d1466de85f68b82cbb500d04dcedf95984f (diff) | |
download | bcm5719-llvm-7eb5cb4ebc69b8b6d995287a68dac01004f79d15.tar.gz bcm5719-llvm-7eb5cb4ebc69b8b6d995287a68dac01004f79d15.zip |
[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
llvm-svn: 344232
Diffstat (limited to 'llvm/lib/Transforms/Vectorize/LoopVectorize.cpp')
-rw-r--r-- | llvm/lib/Transforms/Vectorize/LoopVectorize.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp index c7c4568377b..cad1711b17f 100644 --- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp +++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp @@ -4655,7 +4655,7 @@ LoopVectorizationCostModel::getSmallestAndWidestTypes() { // 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::calculateRegisterUsage(ArrayRef<unsigned> VFs) { 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. |