Skip to content

Commit 7392131

Browse files
authored
[VPlan] Improve code in VPlanPredicator (NFC) (llvm#150416)
1 parent 2b1ce25 commit 7392131

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

llvm/lib/Transforms/Vectorize/VPlanPredicator.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,7 @@ void VPPredicator::createSwitchEdgeMasks(VPInstruction *SI) {
184184
VPValue *Cond = SI->getOperand(0);
185185
VPBasicBlock *DefaultDst = cast<VPBasicBlock>(Src->getSuccessors()[0]);
186186
MapVector<VPBasicBlock *, SmallVector<VPValue *>> Dst2Compares;
187-
for (const auto &[Idx, Succ] :
188-
enumerate(ArrayRef(Src->getSuccessors()).drop_front())) {
187+
for (const auto &[Idx, Succ] : enumerate(drop_begin(Src->getSuccessors()))) {
189188
VPBasicBlock *Dst = cast<VPBasicBlock>(Succ);
190189
assert(!getEdgeMask(Src, Dst) && "Edge masks already created");
191190
// Cases whose destination is the same as default are redundant and can
@@ -206,7 +205,7 @@ void VPPredicator::createSwitchEdgeMasks(VPInstruction *SI) {
206205
// cases with destination == Dst are taken. Join the conditions for each
207206
// case whose destination == Dst using an OR.
208207
VPValue *Mask = Conds[0];
209-
for (VPValue *V : ArrayRef<VPValue *>(Conds).drop_front())
208+
for (VPValue *V : drop_begin(Conds))
210209
Mask = Builder.createOr(Mask, V);
211210
if (SrcMask)
212211
Mask = Builder.createLogicalAnd(SrcMask, Mask);

0 commit comments

Comments
 (0)