Skip to content

Commit 2a40497

Browse files
committed
Improve ext(mul(ext, ext)) comment
1 parent 9dca765 commit 2a40497

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3713,9 +3713,11 @@ tryToMatchAndCreateMulAccumulateReduction(VPReductionRecipe *Red,
37133713
// -> reduce.add(ext(mul(ext, ext(const))))
37143714
ExtendAndReplaceConstantOp(Ext0, Ext1, B, Mul);
37153715

3716-
// Match reduce.add(ext(mul(ext(A), ext(B))))
3717-
// All extend recipes must have same opcode or A == B
3718-
// which can be transformed to reduce.add(zext(mul(sext(A), sext(B)))).
3716+
// reduce.add(ext(mul(ext(A), ext(B))))
3717+
// -> reduce.add(mul(wider_ext(A), wider_ext(B)))
3718+
// The inner extends must either have the same opcode as the outer extend or
3719+
// be the same, in which case the multiply can never result in a negative
3720+
// value and the outer extend opcode doesn't matter
37193721
if (Ext0 && Ext1 &&
37203722
(Ext->getOpcode() == Ext0->getOpcode() || Ext0 == Ext1) &&
37213723
Ext0->getOpcode() == Ext1->getOpcode() &&

0 commit comments

Comments
 (0)