Skip to content
Snippets Groups Projects
Commit 5b5f5942 authored by Craig Topper's avatar Craig Topper
Browse files

[DAGCombiner] Replace call getSExtOrTrunc with a truncate. NFC

The extend case should never occur. The sign extend would be an
arbitrary choice, remove it to avoid confusion.
parent 1342b861
No related branches found
No related tags found
No related merge requests found
......@@ -19474,8 +19474,9 @@ SDValue DAGCombiner::visitEXTRACT_VECTOR_ELT(SDNode *N) {
// EXTRACT_VECTOR_ELT may widen the extracted vector.
SDValue InOp = VecOp.getOperand(0);
if (InOp.getValueType() != ScalarVT) {
assert(InOp.getValueType().isInteger() && ScalarVT.isInteger());
return DAG.getSExtOrTrunc(InOp, DL, ScalarVT);
assert(InOp.getValueType().isInteger() && ScalarVT.isInteger() &&
InOp.getValueType().bitsGT(ScalarVT));
return DAG.getNode(ISD::TRUNCATE, DL, ScalarVT, InOp);
}
return InOp;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment