Skip to content

Commit c3e18b3

Browse files
committed
Force vp.cttz.elts to be legalized in LegalizeDAG
1 parent d572fb5 commit c3e18b3

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1227,6 +1227,11 @@ void SelectionDAGLegalize::LegalizeOp(SDNode *Node) {
12271227
Action = TLI.getOperationAction(
12281228
Node->getOpcode(), Node->getOperand(1).getValueType());
12291229
break;
1230+
case ISD::VP_CTTZ_ELTS:
1231+
case ISD::VP_CTTZ_ELTS_ZERO_UNDEF:
1232+
Action = TLI.getOperationAction(Node->getOpcode(),
1233+
Node->getOperand(0).getValueType());
1234+
break;
12301235
default:
12311236
if (Node->getOpcode() >= ISD::BUILTIN_OP_END) {
12321237
Action = TLI.getCustomOperationAction(*Node);
@@ -4282,6 +4287,10 @@ bool SelectionDAGLegalize::ExpandNode(SDNode *Node) {
42824287
case ISD::VECREDUCE_FMINIMUM:
42834288
Results.push_back(TLI.expandVecReduce(Node, DAG));
42844289
break;
4290+
case ISD::VP_CTTZ_ELTS:
4291+
case ISD::VP_CTTZ_ELTS_ZERO_UNDEF:
4292+
Results.push_back(TLI.expandVPCTTZElements(Node, DAG));
4293+
break;
42854294
case ISD::GLOBAL_OFFSET_TABLE:
42864295
case ISD::GlobalAddress:
42874296
case ISD::GlobalTLSAddress:

llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -963,13 +963,6 @@ void VectorLegalizer::Expand(SDNode *Node, SmallVectorImpl<SDValue> &Results) {
963963
return;
964964
}
965965
break;
966-
case ISD::VP_CTTZ_ELTS:
967-
case ISD::VP_CTTZ_ELTS_ZERO_UNDEF:
968-
if (SDValue Expanded = TLI.expandVPCTTZElements(Node, DAG)) {
969-
Results.push_back(Expanded);
970-
return;
971-
}
972-
break;
973966
case ISD::FSHL:
974967
case ISD::VP_FSHL:
975968
case ISD::FSHR:

0 commit comments

Comments
 (0)