From 85a06a9918cb62d3d5a6ee762d4f3c0b1587823e Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Sat, 22 Sep 2018 23:12:34 +0000 Subject: [PATCH] [DAGCombiner] Simplify some code in visitBITCAST. NFCI llvm-svn: 342826 --- lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 0493fde5fa2..6d19f226a28 100644 --- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -9841,15 +9841,9 @@ SDValue DAGCombiner::visitBITCAST(SDNode *N) { // First check to see if this is all constant. if (!LegalTypes && N0.getOpcode() == ISD::BUILD_VECTOR && N0.getNode()->hasOneUse() && - VT.isVector()) { - bool isSimple = cast(N0)->isConstant(); - - EVT DestEltVT = N->getValueType(0).getVectorElementType(); - assert(!DestEltVT.isVector() && - "Element type of vector ValueType must not be vector!"); - if (isSimple) - return ConstantFoldBITCASTofBUILD_VECTOR(N0.getNode(), DestEltVT); - } + VT.isVector() && cast(N0)->isConstant()) + return ConstantFoldBITCASTofBUILD_VECTOR(N0.getNode(), + VT.getVectorElementType()); // If the input is a constant, let getNode fold it. if (isa(N0) || isa(N0)) {