Skip to content

Commit 912cdd2

Browse files
committed
[DAG] AddNodeIDCustom - call ShuffleVectorSDNode::getMask once instead of repeated getMaskElt calls.
Use a simpler for-range loop to append all shuffle mask elements
1 parent 042800a commit 912cdd2

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -909,10 +909,9 @@ static void AddNodeIDCustom(FoldingSetNodeID &ID, const SDNode *N) {
909909
break;
910910
}
911911
case ISD::VECTOR_SHUFFLE: {
912-
const ShuffleVectorSDNode *SVN = cast<ShuffleVectorSDNode>(N);
913-
for (unsigned i = 0, e = N->getValueType(0).getVectorNumElements();
914-
i != e; ++i)
915-
ID.AddInteger(SVN->getMaskElt(i));
912+
ArrayRef<int> Mask = cast<ShuffleVectorSDNode>(N)->getMask();
913+
for (int M : Mask)
914+
ID.AddInteger(M);
916915
break;
917916
}
918917
case ISD::TargetBlockAddress:

0 commit comments

Comments
 (0)