Skip to content

Commit 6f2840d

Browse files
authored
[VPlan] Improve iterator-related code (NFC) (llvm#155834)
1 parent 9ae28b6 commit 6f2840d

File tree

1 file changed

+5
-8
lines changed
  • llvm/lib/Transforms/Vectorize

1 file changed

+5
-8
lines changed

llvm/lib/Transforms/Vectorize/VPlan.h

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1645,10 +1645,8 @@ class LLVM_ABI_FOR_TEST VPWidenCallRecipe : public VPRecipeWithIRFlags,
16451645
return cast<Function>(getOperand(getNumOperands() - 1)->getLiveInIRValue());
16461646
}
16471647

1648-
operand_range args() { return make_range(op_begin(), std::prev(op_end())); }
1649-
const_operand_range args() const {
1650-
return make_range(op_begin(), std::prev(op_end()));
1651-
}
1648+
operand_range args() { return drop_end(operands()); }
1649+
const_operand_range args() const { return drop_end(operands()); }
16521650

16531651
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
16541652
/// Print the recipe.
@@ -2382,9 +2380,8 @@ class LLVM_ABI_FOR_TEST VPBlendRecipe : public VPSingleDefRecipe {
23822380
}
23832381

23842382
VPBlendRecipe *clone() override {
2385-
SmallVector<VPValue *> Ops(operands());
2386-
return new VPBlendRecipe(cast_or_null<PHINode>(getUnderlyingValue()), Ops,
2387-
getDebugLoc());
2383+
return new VPBlendRecipe(cast_or_null<PHINode>(getUnderlyingValue()),
2384+
operands(), getDebugLoc());
23882385
}
23892386

23902387
VP_CLASSOF_IMPL(VPDef::VPBlendSC)
@@ -4143,7 +4140,7 @@ class VPlan {
41434140
/// Returns an iterator range over all VFs of the plan.
41444141
iterator_range<SmallSetVector<ElementCount, 2>::iterator>
41454142
vectorFactors() const {
4146-
return {VFs.begin(), VFs.end()};
4143+
return VFs;
41474144
}
41484145

41494146
bool hasScalarVFOnly() const {

0 commit comments

Comments
 (0)