diff options
author | Mon P Wang <wangmp@apple.com> | 2008-12-09 05:46:39 +0000 |
---|---|---|
committer | Mon P Wang <wangmp@apple.com> | 2008-12-09 05:46:39 +0000 |
commit | 4dd832d24133612f09af3c4fb0d36e63fb5ee6f3 (patch) | |
tree | 3be72357a03ee634d44ec7082cacfc153b6900eb /llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | |
parent | 56b20ffc5facbc5222992b1216ba416c038aaf22 (diff) | |
download | llvm-4dd832d24133612f09af3c4fb0d36e63fb5ee6f3.zip llvm-4dd832d24133612f09af3c4fb0d36e63fb5ee6f3.tar.gz llvm-4dd832d24133612f09af3c4fb0d36e63fb5ee6f3.tar.bz2 |
Fix getNode to allow a vector for the shift amount for shifts of vectors.
Fix the shift amount when unrolling a vector shift into scalar shifts.
Fix problem in getShuffleScalarElt where it assumes that the input of
a bit convert must be a vector.
llvm-svn: 60740
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 6fc2a67..34f0cca 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -2066,7 +2066,8 @@ SDValue SelectionDAG::getShuffleScalarElt(const SDNode *N, unsigned i) { if (V.getOpcode() == ISD::BIT_CONVERT) { V = V.getOperand(0); - if (V.getValueType().getVectorNumElements() != NumElems) + MVT VVT = V.getValueType(); + if (!VVT.isVector() || VVT.getVectorNumElements() != NumElems) return SDValue(); } if (V.getOpcode() == ISD::SCALAR_TO_VECTOR) @@ -2418,7 +2419,8 @@ SDValue SelectionDAG::getNode(unsigned Opcode, MVT VT, "Shift operators return type must be the same as their first arg"); assert(VT.isInteger() && N2.getValueType().isInteger() && "Shifts only work on integers"); - assert(N2.getValueType() == TLI.getShiftAmountTy() && + assert((N2.getValueType() == TLI.getShiftAmountTy() || + (N2.getValueType().isVector() && N2.getValueType().isInteger())) && "Wrong type for shift amount"); // Always fold shifts of i1 values so the code generator doesn't need to |