diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2013-01-27 15:04:43 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2013-01-27 15:04:43 +0000 |
commit | 084e675e173d5949d1ec3ad29416bb167e4e014f (patch) | |
tree | 69b6b4fe210e640c09690cf2048be9f0c490a8c8 /llvm/lib/CodeGen | |
parent | 385bbc15944c27af3464f244d8b76dfb18d9b5d3 (diff) | |
download | bcm5719-llvm-084e675e173d5949d1ec3ad29416bb167e4e014f.tar.gz bcm5719-llvm-084e675e173d5949d1ec3ad29416bb167e4e014f.zip |
Legalizer: Add an assert and tweak a comment to clarify the assumptions this code makes.
llvm-svn: 173620
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp index e08dd6dcb6d..88e72ecd929 100644 --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp @@ -2098,9 +2098,13 @@ void DAGTypeLegalizer::ExpandIntRes_Shift(SDNode *N, EVT VT = LHSL.getValueType(); // If the shift amount operand is coming from a vector legalization it may - // not have the right return type. Fix that first by casting the operand. + // have an illegal type. Fix that first by casting the operand. Otherwise + // the new SHL_PARTS operation would need further legalization, and the + // legalizer assumes that illegal SHL_PARTS never occur. SDValue ShiftOp = N->getOperand(1); MVT ShiftTy = TLI.getShiftAmountTy(VT); + assert(ShiftTy.getSizeInBits() >= Log2_32_Ceil(VT.getSizeInBits()) && + "ShiftAmountTy is too small to cover the range of this type!"); if (ShiftOp.getValueType() != ShiftTy) ShiftOp = DAG.getZExtOrTrunc(ShiftOp, dl, ShiftTy); |