[llvm] r294109 - [DAGCombiner] Use DAG.getAnyExtOrTrunc to simplify some code. NFC
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Sat Feb 4 15:26:37 PST 2017
Author: ctopper
Date: Sat Feb 4 17:26:37 2017
New Revision: 294109
URL: http://llvm.org/viewvc/llvm-project?rev=294109&view=rev
Log:
[DAGCombiner] Use DAG.getAnyExtOrTrunc to simplify some code. NFC
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=294109&r1=294108&r2=294109&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Sat Feb 4 17:26:37 2017
@@ -12828,11 +12828,7 @@ SDValue DAGCombiner::visitINSERT_VECTOR_
// 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
More information about the llvm-commits
mailing list