[DAGCombiner] Use DAG.getAnyExtOrTrunc to simplify some code. NFC

llvm-svn: 294109
This commit is contained in:
Craig Topper 2017-02-04 23:26:37 +00:00
parent ceaf9c1633
commit 04dce84ead
1 changed files with 1 additions and 5 deletions

View File

@ -12828,11 +12828,7 @@ SDValue DAGCombiner::visitINSERT_VECTOR_ELT(SDNode *N) {
// All the operands of BUILD_VECTOR must have the same type;
// we enforce that here.
EVT OpVT = Ops[0].getValueType();
if (InVal.getValueType() != OpVT)
InVal = OpVT.bitsGT(InVal.getValueType()) ?
DAG.getNode(ISD::ANY_EXTEND, DL, OpVT, InVal) :
DAG.getNode(ISD::TRUNCATE, DL, OpVT, InVal);
Ops[Elt] = InVal;
Ops[Elt] = OpVT.isInteger() ? DAG.getAnyExtOrTrunc(InVal, DL, OpVT) : InVal;
}
// Return the new vector