Skip to content

Commit 83a61a0

Browse files
committed
!fixup fix formatting
1 parent 0f16313 commit 83a61a0

File tree

3 files changed

+19
-12
lines changed

3 files changed

+19
-12
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@
5656
#include "llvm/Transforms/Vectorize/LoopVectorize.h"
5757
#include "LoopVectorizationPlanner.h"
5858
#include "VPRecipeBuilder.h"
59-
#include "VPlanPatternMatch.h"
6059
#include "VPlan.h"
6160
#include "VPlanAnalysis.h"
6261
#include "VPlanHCFGBuilder.h"
62+
#include "VPlanPatternMatch.h"
6363
#include "VPlanTransforms.h"
6464
#include "VPlanVerifier.h"
6565
#include "llvm/ADT/APInt.h"
@@ -607,8 +607,8 @@ class InnerLoopVectorizer {
607607
BasicBlock *MiddleBlock, BasicBlock *VectorHeader,
608608
VPlan &Plan, VPTransformState &State);
609609

610-
/// Create the phi node for the resume value of first order recurrences in the scalar preheader and
611-
/// update the users in the scalar loop.
610+
/// Create the phi node for the resume value of first order recurrences in the
611+
/// scalar preheader and update the users in the scalar loop.
612612
void fixFixedOrderRecurrence(VPLiveOut *LO, VPTransformState &State);
613613

614614
/// Iteratively sink the scalarized operands of a predicated instruction into
@@ -3475,22 +3475,26 @@ void InnerLoopVectorizer::fixFixedOrderRecurrence(VPLiveOut *LO,
34753475
// Extract the last vector element in the middle block. This will be the
34763476
// initial value for the recurrence when jumping to the scalar loop.
34773477
VPValue *VPExtract = LO->getOperand(0);
3478-
using namespace llvm::VPlanPatternMatch;
3479-
assert(match(VPExtract, m_VPInstruction<VPInstruction::ExtractFromEnd>(m_VPValue(), m_VPValue())) && "FOR LiveOut expects to use an extract from end.");
3478+
using namespace llvm::VPlanPatternMatch;
3479+
assert(match(VPExtract, m_VPInstruction<VPInstruction::ExtractFromEnd>(
3480+
m_VPValue(), m_VPValue())) &&
3481+
"FOR LiveOut expects to use an extract from end.");
34803482
Value *ResumeScalarFOR = State.get(VPExtract, UF - 1, true);
34813483

34823484
// Fix the initial value of the original recurrence in the scalar loop.
34833485
Builder.SetInsertPoint(LoopScalarPreHeader, LoopScalarPreHeader->begin());
34843486
PHINode *ScalarHeaderPhi = LO->getPhi();
3485-
auto *NewScalarHeaderPhi = Builder.CreatePHI(ScalarHeaderPhi->getType(), 2, "scalar.recur.init");
3487+
auto *NewScalarHeaderPhi =
3488+
Builder.CreatePHI(ScalarHeaderPhi->getType(), 2, "scalar.recur.init");
34863489
auto *InitScalarFOR =
34873490
ScalarHeaderPhi->getIncomingValueForBlock(LoopScalarPreHeader);
34883491
for (auto *BB : predecessors(LoopScalarPreHeader)) {
34893492
auto *Incoming = BB == LoopMiddleBlock ? ResumeScalarFOR : InitScalarFOR;
3490-
NewScalarHeaderPhi ->addIncoming(Incoming, BB);
3493+
NewScalarHeaderPhi->addIncoming(Incoming, BB);
34913494
}
34923495

3493-
ScalarHeaderPhi->setIncomingValueForBlock(LoopScalarPreHeader, NewScalarHeaderPhi );
3496+
ScalarHeaderPhi->setIncomingValueForBlock(LoopScalarPreHeader,
3497+
NewScalarHeaderPhi);
34943498
ScalarHeaderPhi->setName("scalar.recur");
34953499
}
34963500

llvm/lib/Transforms/Vectorize/VPlan.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3166,7 +3166,9 @@ class VPlan {
31663166
/// definitions are VPValues that hold a pointer to their underlying IR.
31673167
SmallVector<VPValue *, 16> VPLiveInsToFree;
31683168

3169-
/// Values used outside the plan. It contains live-outs that need fixing. Any live-out that is fixed outside VPlan needs to be removed. The remaining live-outs are fixed via VPLiveOut::fixPhi.
3169+
/// Values used outside the plan. It contains live-outs that need fixing. Any
3170+
/// live-out that is fixed outside VPlan needs to be removed. The remaining
3171+
/// live-outs are fixed via VPLiveOut::fixPhi.
31703172
MapVector<PHINode *, VPLiveOut *> LiveOuts;
31713173

31723174
/// Mapping from SCEVs to the VPValues representing their expansions.

llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -887,7 +887,7 @@ bool VPlanTransforms::adjustFixedOrderRecurrences(VPlan &Plan,
887887
//
888888
// middle.block:
889889
// s_penultimate = v2(2) = v3(3)
890-
// s_resume = v2(3)
890+
// s_resume = v2(3)
891891
// br cond, scalar.ph, exit.block
892892
//
893893
// scalar.ph:
@@ -903,13 +903,14 @@ bool VPlanTransforms::adjustFixedOrderRecurrences(VPlan &Plan,
903903
//
904904
// exit.block:
905905
// lo = lcssa.phi [s1, scalar.body], [s.penultimate, middle.block]
906-
//
906+
//
907907
// After execution completes the vector loop, we extract the next value of
908908
// the recurrence (x) to use as the initial value in the scalar loop. This
909909
// is modeled by ExtractFromEnd.
910910
Type *IntTy = Plan.getCanonicalIV()->getScalarType();
911911

912-
// Extract the penultimate value of the recurrence and update VPLiveOut users of the recurrence splice.
912+
// Extract the penultimate value of the recurrence and update VPLiveOut
913+
// users of the recurrence splice.
913914
auto *Penultimate = cast<VPInstruction>(MiddleBuilder.createNaryOp(
914915
VPInstruction::ExtractFromEnd,
915916
{FOR->getBackedgeValue(),

0 commit comments

Comments
 (0)