[llvm] r331174 - [LV] Use BB::instructionsWithoutDebug to skip DbgInfo (NFC).
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 30 06:28:08 PDT 2018
Author: fhahn
Date: Mon Apr 30 06:28:08 2018
New Revision: 331174
URL: http://llvm.org/viewvc/llvm-project?rev=331174&view=rev
Log:
[LV] Use BB::instructionsWithoutDebug to skip DbgInfo (NFC).
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: mkuper, rengolin, dcaballe, aprantl, vsk
Reviewed By: rengolin
Differential Revision: https://reviews.llvm.org/D46254
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=331174&r1=331173&r2=331174&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp (original)
+++ llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp Mon Apr 30 06:28:08 2018
@@ -5552,11 +5552,7 @@ LoopVectorizationCostModel::expectedCost
VectorizationCostTy BlockCost;
// For each instruction in the old loop.
- for (Instruction &I : *BB) {
- // Skip dbg intrinsics.
- if (isa<DbgInfoIntrinsic>(I))
- continue;
-
+ for (Instruction &I : BB->instructionsWithoutDebug()) {
// Skip ignored values.
if (ValuesToIgnore.count(&I) ||
(VF > 1 && VecValuesToIgnore.count(&I)))
@@ -6864,13 +6860,12 @@ LoopVectorizationPlanner::buildVPlan(VFR
// Organize the ingredients to vectorize from current basic block in the
// right order.
- for (Instruction &I : *BB) {
+ for (Instruction &I : BB->instructionsWithoutDebug()) {
Instruction *Instr = &I;
// First filter out irrelevant instructions, to ensure no recipes are
// built for them.
- if (isa<BranchInst>(Instr) || isa<DbgInfoIntrinsic>(Instr) ||
- DeadInstructions.count(Instr))
+ if (isa<BranchInst>(Instr) || DeadInstructions.count(Instr))
continue;
// I is a member of an InterleaveGroup for Range.Start. If it's an adjunct
More information about the llvm-commits
mailing list