diff options
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 1d8cdb60c92..73fe1990711 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -2872,11 +2872,12 @@ SDValue SelectionDAG::getNode(unsigned Opcode, SDLoc DL, EVT InVT = BV->getValueType(0); EVT InSVT = InVT.getScalarType(); - // Find legal integer scalar type for constant promotion. + // Find legal integer scalar type for constant promotion and + // ensure that its scalar size is at least as large as source. EVT LegalSVT = SVT; if (SVT.isInteger()) { LegalSVT = TLI->getTypeToTransformTo(*getContext(), SVT); - assert(LegalSVT.bitsGE(SVT) && "Unexpected legal scalar type size"); + if (LegalSVT.bitsLT(SVT)) break; } // Let the above scalar folding handle the folding of each element. |

