Skip to content

Commit 685e190

Browse files
committed
[LegalizeDAG] Use scalable aware idiom for checking for single element vector
NFC for fixed vectors (all that reaches here currently), and future proofing for scalable vectors.
1 parent 89f0314 commit 685e190

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3333,7 +3333,7 @@ bool SelectionDAGLegalize::ExpandNode(SDNode *Node) {
33333333
Results.push_back(DAG.expandVACopy(Node));
33343334
break;
33353335
case ISD::EXTRACT_VECTOR_ELT:
3336-
if (Node->getOperand(0).getValueType().getVectorNumElements() == 1)
3336+
if (Node->getOperand(0).getValueType().getVectorElementCount().isScalar())
33373337
// This must be an access of the only element. Return it.
33383338
Tmp1 = DAG.getNode(ISD::BITCAST, dl, Node->getValueType(0),
33393339
Node->getOperand(0));

0 commit comments

Comments
 (0)