File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -1567,13 +1567,12 @@ InstructionCost X86TTIImpl::getShuffleCost(
1567
1567
Mask.size () == BaseTp->getElementCount ().getKnownMinValue ()) {
1568
1568
unsigned NumLanes = BaseTp->getPrimitiveSizeInBits () / 128 ;
1569
1569
unsigned NumEltsPerLane = Mask.size () / NumLanes;
1570
- if ((Mask.size () % NumLanes) == 0 ) {
1571
- IsInLaneShuffle = true ;
1572
- for (auto [I, M] : enumerate(Mask))
1573
- if (0 <= M)
1574
- IsInLaneShuffle &=
1575
- ((M % Mask.size ()) / NumEltsPerLane) == (I / NumEltsPerLane);
1576
- }
1570
+ if ((Mask.size () % NumLanes) == 0 )
1571
+ IsInLaneShuffle = all_of (enumerate(Mask), [&](const auto &P) {
1572
+ return P.value () == PoisonMaskElem ||
1573
+ ((P.value () % Mask.size ()) / NumEltsPerLane) ==
1574
+ (P.index () / NumEltsPerLane);
1575
+ });
1577
1576
}
1578
1577
1579
1578
// Treat <X x bfloat> shuffles as <X x half>.
You can’t perform that action at this time.
0 commit comments