Skip to content

Commit 0bd577a

Browse files
committed
Fix typos and format issues
1 parent 894d98c commit 0bd577a

File tree

3 files changed

+16
-14
lines changed

3 files changed

+16
-14
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1077,7 +1077,7 @@ bool LoopVectorizationLegality::canVectorizeInstrs() {
10771077
/// When updateOperator can be add, sub, add.sat, umin, umax.
10781078
///
10791079
/// It matches a pattern starting from \p HSt, which Stores to the 'buckets'
1080-
/// array the computed histogram. It uses a update instruction to update all
1080+
/// array the computed histogram. It uses an update instruction to update all
10811081
/// counts, storing them using a loop-variant index Load from the 'indices'
10821082
/// input array.
10831083
///
@@ -1099,14 +1099,16 @@ static bool findHistogram(LoadInst *LI, StoreInst *HSt, Loop *TheLoop,
10991099
// FIXME: We assume the loop invariant term is on the RHS.
11001100
// Fine for an immediate/constant, but maybe not a generic value?
11011101
Value *HIncVal = nullptr;
1102-
if (!match(HUpdateOp, m_Add(m_Load(m_Specific(HPtrInstr)), m_Value(HIncVal))) &&
1103-
!match(HUpdateOp, m_Sub(m_Load(m_Specific(HPtrInstr)), m_Value(HIncVal))) &&
1102+
if (!match(HUpdateOp,
1103+
m_Add(m_Load(m_Specific(HPtrInstr)), m_Value(HIncVal))) &&
1104+
!match(HUpdateOp,
1105+
m_Sub(m_Load(m_Specific(HPtrInstr)), m_Value(HIncVal))) &&
11041106
!match(HUpdateOp, m_Intrinsic<Intrinsic::uadd_sat>(
1105-
m_Load(m_Specific(HPtrInstr)), m_Value(HIncVal))) &&
1106-
!match(HUpdateOp, m_Intrinsic<Intrinsic::umax>(m_Load(m_Specific(HPtrInstr)),
1107-
m_Value(HIncVal))) &&
1108-
!match(HUpdateOp, m_Intrinsic<Intrinsic::umin>(m_Load(m_Specific(HPtrInstr)),
1109-
m_Value(HIncVal))))
1107+
m_Load(m_Specific(HPtrInstr)), m_Value(HIncVal))) &&
1108+
!match(HUpdateOp, m_Intrinsic<Intrinsic::umax>(
1109+
m_Load(m_Specific(HPtrInstr)), m_Value(HIncVal))) &&
1110+
!match(HUpdateOp, m_Intrinsic<Intrinsic::umin>(
1111+
m_Load(m_Specific(HPtrInstr)), m_Value(HIncVal))))
11101112
return false;
11111113

11121114
// Make sure the increment value is loop invariant.

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8657,7 +8657,7 @@ VPRecipeBuilder::tryToWidenHistogram(const HistogramInfo *HI,
86578657
// FIXME: Support other operations.
86588658
unsigned Opcode = HI->Update->getOpcode();
86598659
assert(VPHistogramRecipe::isLegalUpdateInstruction(HI->Update) &&
8660-
"Found Ilegal update instruction for histogram");
8660+
"Found Illegal update instruction for histogram");
86618661

86628662
SmallVector<VPValue *, 3> HGramOps;
86638663
// Bucket address.

llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1238,7 +1238,7 @@ void VPHistogramRecipe::execute(VPTransformState &State) {
12381238
if (Opcode == Instruction::Sub)
12391239
IncAmt = Builder.CreateNeg(IncAmt);
12401240
assert(isLegalUpdateInstruction(UpdateInst) &&
1241-
"Found Ilegal update instruction for histogram");
1241+
"Found Illegal update instruction for histogram");
12421242

12431243
State.Builder.CreateIntrinsic(getHistogramOpcode(UpdateInst),
12441244
{VTy, IncAmt->getType()},
@@ -1293,7 +1293,7 @@ void VPHistogramRecipe::print(raw_ostream &O, const Twine &Indent,
12931293
VPSlotTracker &SlotTracker) const {
12941294
auto *UpdateInst = cast<Instruction>(getOperand(2)->getUnderlyingValue());
12951295
assert(isLegalUpdateInstruction(UpdateInst) &&
1296-
"Found Ilegal update instruction for histogram");
1296+
"Found Illegal update instruction for histogram");
12971297
O << Indent << "WIDEN-HISTOGRAM buckets: ";
12981298
getOperand(0)->printAsOperand(O, SlotTracker);
12991299

@@ -1315,7 +1315,7 @@ void VPHistogramRecipe::print(raw_ostream &O, const Twine &Indent,
13151315
O << ", min: ";
13161316
break;
13171317
default:
1318-
llvm_unreachable("Found Ilegal update instruction for histogram");
1318+
llvm_unreachable("Found Illegal update instruction for histogram");
13191319
}
13201320
}
13211321
getOperand(1)->printAsOperand(O, SlotTracker);
@@ -1349,7 +1349,7 @@ unsigned VPHistogramRecipe::getHistogramOpcode(Instruction *I) {
13491349
// We only support add and sub instructions and the following list of
13501350
// intrinsics: uadd.sat, umax, umin.
13511351
assert(isLegalUpdateInstruction(I) &&
1352-
"Found Ilegal update instruction for histogram");
1352+
"Found Illegal update instruction for histogram");
13531353
if (isa<BinaryOperator>(I))
13541354
return Intrinsic::experimental_vector_histogram_add;
13551355
auto *II = cast<IntrinsicInst>(I);
@@ -1361,7 +1361,7 @@ unsigned VPHistogramRecipe::getHistogramOpcode(Instruction *I) {
13611361
case Intrinsic::umin:
13621362
return Intrinsic::experimental_vector_histogram_umin;
13631363
default:
1364-
llvm_unreachable("Found Ilegal update instruction for histogram");
1364+
llvm_unreachable("Found Illegal update instruction for histogram");
13651365
}
13661366
}
13671367

0 commit comments

Comments
 (0)