Skip to content

Commit abe57fb

Browse files
committed
Format
1 parent 34d5f25 commit abe57fb

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8824,11 +8824,10 @@ void VPRecipeBuilder::collectScaledReductions(VFRange &Range) {
88248824
}
88258825

88268826
std::optional<SmallVector<std::pair<PartialReductionChain, unsigned>>>
8827-
VPRecipeBuilder::getScaledReduction(Instruction *PHI,
8828-
Instruction *RdxExitInstr,
8827+
VPRecipeBuilder::getScaledReduction(Instruction *PHI, Instruction *RdxExitInstr,
88298828
VFRange &Range) {
88308829

8831-
if(!CM.TheLoop->contains(RdxExitInstr))
8830+
if (!CM.TheLoop->contains(RdxExitInstr))
88328831
return std::nullopt;
88338832

88348833
// TODO: Allow scaling reductions when predicating. The select at
@@ -8850,7 +8849,7 @@ VPRecipeBuilder::getScaledReduction(Instruction *PHI,
88508849
SmallVector<std::pair<PartialReductionChain, unsigned>> Chains;
88518850

88528851
if (auto *OpInst = dyn_cast<Instruction>(Op)) {
8853-
if(auto SR0 = getScaledReduction(PHI, OpInst, Range)) {
8852+
if (auto SR0 = getScaledReduction(PHI, OpInst, Range)) {
88548853
Chains.append(*SR0);
88558854
PHI = SR0->rbegin()->first.Reduction;
88568855

@@ -9000,7 +8999,8 @@ VPRecipeBuilder::tryToCreatePartialReduction(Instruction *Reduction,
90008999
VPValue *BinOp = Operands[0];
90019000
VPValue *Phi = Operands[1];
90029001
VPRecipeBase *BinOpRecipe = BinOp->getDefiningRecipe();
9003-
if (isa<VPReductionPHIRecipe>(BinOpRecipe) || isa<VPPartialReductionRecipe>(BinOpRecipe))
9002+
if (isa<VPReductionPHIRecipe>(BinOpRecipe) ||
9003+
isa<VPPartialReductionRecipe>(BinOpRecipe))
90049004
std::swap(BinOp, Phi);
90059005

90069006
return new VPPartialReductionRecipe(Reduction->getOpcode(), BinOp, Phi,

llvm/lib/Transforms/Vectorize/VPlan.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2454,13 +2454,15 @@ class VPPartialReductionRecipe : public VPSingleDefRecipe {
24542454
ArrayRef<VPValue *>({Op0, Op1}), ReductionInst),
24552455
Opcode(Opcode) {
24562456
auto *DefiningRecipe = getOperand(1)->getDefiningRecipe();
2457-
assert((isa<VPReductionPHIRecipe>(DefiningRecipe) || isa<VPPartialReductionRecipe>(DefiningRecipe)) &&
2457+
assert((isa<VPReductionPHIRecipe>(DefiningRecipe) ||
2458+
isa<VPPartialReductionRecipe>(DefiningRecipe)) &&
24582459
"Unexpected operand order for partial reduction recipe");
24592460
}
24602461
~VPPartialReductionRecipe() override = default;
24612462

24622463
VPPartialReductionRecipe *clone() override {
2463-
return new VPPartialReductionRecipe(Opcode, getOperand(0), getOperand(1), getUnderlyingInstr());
2464+
return new VPPartialReductionRecipe(Opcode, getOperand(0), getOperand(1),
2465+
getUnderlyingInstr());
24642466
}
24652467

24662468
VP_CLASSOF_IMPL(VPDef::VPPartialReductionSC)

llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,8 +325,9 @@ void VPPartialReductionRecipe::execute(VPTransformState &State) {
325325

326326
// Currently we don't have a partial_reduce_sub intrinsic,
327327
// so mimic the behaviour by negating the second operand
328-
if(Opcode == Instruction::Sub) {
329-
BinOpVal = Builder.CreateSub(Constant::getNullValue(BinOpVal->getType()), BinOpVal);
328+
if (Opcode == Instruction::Sub) {
329+
BinOpVal = Builder.CreateSub(Constant::getNullValue(BinOpVal->getType()),
330+
BinOpVal);
330331
Opcode = Instruction::Add;
331332
}
332333

0 commit comments

Comments
 (0)