SelectionDAG::SignBitIsZero doesn't work right for vectors,
authorChris Lattner <sabre@nondot.org>
Tue, 7 Jul 2009 23:28:46 +0000 (23:28 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 7 Jul 2009 23:28:46 +0000 (23:28 +0000)
for now, conservatively return false.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74969 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/SelectionDAG.cpp

index 5f45c980a582bf7cf7f713dc1cb26f286624085a..c46eee8a4edd3dac6258705879d859ddc67a7659 100644 (file)
@@ -1516,6 +1516,10 @@ SDValue SelectionDAG::FoldSetCC(MVT VT, SDValue N1,
 /// SignBitIsZero - Return true if the sign bit of Op is known to be zero.  We
 /// use this predicate to simplify operations downstream.
 bool SelectionDAG::SignBitIsZero(SDValue Op, unsigned Depth) const {
+  // This predicate is not safe for vector operations.
+  if (Op.getValueType().isVector())
+    return false;
+  
   unsigned BitWidth = Op.getValueSizeInBits();
   return MaskedValueIsZero(Op, APInt::getSignBit(BitWidth), Depth);
 }