diff options
| author | Chris Lattner <sabre@nondot.org> | 2008-01-27 23:21:58 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2008-01-27 23:21:58 +0000 |
| commit | d0496d04331bc6dff3216e3cf3c839d0e5aadaae (patch) | |
| tree | 79da17827e7f30f0a681d12f409387d6c8b24a9f /llvm/lib | |
| parent | d329270854f9ee785dba890af5c5aad955362c17 (diff) | |
| download | bcm5719-llvm-d0496d04331bc6dff3216e3cf3c839d0e5aadaae.tar.gz bcm5719-llvm-d0496d04331bc6dff3216e3cf3c839d0e5aadaae.zip | |
fix a crash on CodeGen/X86/vector-rem.ll
llvm-svn: 46422
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 2c2f5e95b06..5d1f70f2eb7 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -1306,10 +1306,12 @@ SDOperand DAGCombiner::visitSREM(SDNode *N) { return DAG.getNode(ISD::SREM, VT, N0, N1); // If we know the sign bits of both operands are zero, strength reduce to a // urem instead. Handles (X & 0x0FFFFFFF) %s 16 -> X&15 - uint64_t SignBit = MVT::getIntVTSignBit(VT); - if (DAG.MaskedValueIsZero(N1, SignBit) && - DAG.MaskedValueIsZero(N0, SignBit)) - return DAG.getNode(ISD::UREM, VT, N0, N1); + if (!MVT::isVector(VT)) { + uint64_t SignBit = MVT::getIntVTSignBit(VT); + if (DAG.MaskedValueIsZero(N1, SignBit) && + DAG.MaskedValueIsZero(N0, SignBit)) + return DAG.getNode(ISD::UREM, VT, N0, N1); + } // If X/C can be simplified by the division-by-constant logic, lower // X%C to the equivalent of X-X/C*C. |

