diff options
author | Craig Topper <craig.topper@intel.com> | 2018-09-22 23:12:34 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@intel.com> | 2018-09-22 23:12:34 +0000 |
commit | 81f67f7afb7d16ab346a3bc2d7682754c0c713f9 (patch) | |
tree | ba38e9bb8423a7f7c980381b387cec76838504d4 /llvm/lib/CodeGen | |
parent | dfc3b7bbf77437b3f3be4af7d989b591d9fa4441 (diff) | |
download | bcm5719-llvm-81f67f7afb7d16ab346a3bc2d7682754c0c713f9.tar.gz bcm5719-llvm-81f67f7afb7d16ab346a3bc2d7682754c0c713f9.zip |
[DAGCombiner] Simplify some code in visitBITCAST. NFCI
llvm-svn: 342826
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 0493fde5fa2..6d19f226a28 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/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<BuildVectorSDNode>(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<BuildVectorSDNode>(N0)->isConstant()) + return ConstantFoldBITCASTofBUILD_VECTOR(N0.getNode(), + VT.getVectorElementType()); // If the input is a constant, let getNode fold it. if (isa<ConstantSDNode>(N0) || isa<ConstantFPSDNode>(N0)) { |