Skip to content

Commit 03c0f18

Browse files
committed
Address review comment
1 parent bf2645a commit 03c0f18

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5644,14 +5644,16 @@ InstructionCost AArch64TTIImpl::getPartialReductionCost(
56445644
OpAExtend == TTI::PR_None)
56455645
return Invalid;
56465646

5647+
assert((BinOp || (OpBExtend == TTI::PR_None && !InputTypeB)) &&
5648+
(!BinOp || (OpBExtend != TTI::PR_None && InputTypeB)) &&
5649+
"Unexpected values for OpBExtend or InputTypeB");
5650+
56475651
// We only support multiply binary operations for now, and for muls we
56485652
// require the types being extended to be the same.
56495653
if (BinOp && (*BinOp != Instruction::Mul || InputTypeA != InputTypeB))
56505654
return Invalid;
5651-
assert((BinOp || (OpBExtend == TTI::PR_None && !InputTypeB)) &&
5652-
"Unexpected values for OpBExtend or InputTypeB");
56535655

5654-
bool IsUSDot = OpBExtend && OpAExtend != OpBExtend;
5656+
bool IsUSDot = OpBExtend != TTI::PR_None && OpAExtend != OpBExtend;
56555657
if (IsUSDot && !ST->hasMatMulInt8())
56565658
return Invalid;
56575659

@@ -5663,8 +5665,7 @@ InstructionCost AArch64TTIImpl::getPartialReductionCost(
56635665
VectorType *InputVectorType = VectorType::get(InputTypeA, VF);
56645666
VectorType *AccumVectorType =
56655667
VectorType::get(AccumType, VF.divideCoefficientBy(Ratio));
5666-
// We don't yet support all kinds of legalization (e.g. widening
5667-
// of <[vscale x] 1 x ..> accumulators)
5668+
// We don't yet support all kinds of legalization.
56685669
auto TA = TLI->getTypeAction(AccumVectorType->getContext(),
56695670
EVT::getEVT(AccumVectorType));
56705671
switch (TA) {

0 commit comments

Comments
 (0)