SelectionDAG: add missing ComputeSignBits case for SELECT_CC
authorFiona Glaser <escha@apple.com>
Sat, 29 Aug 2015 23:04:38 +0000 (23:04 +0000)
committerFiona Glaser <escha@apple.com>
Sat, 29 Aug 2015 23:04:38 +0000 (23:04 +0000)
Identical to SELECT, just with different operand numbers.

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

lib/CodeGen/SelectionDAG/SelectionDAG.cpp

index 82537eb89231b28c3c061374a62209873d33ca8b..7ccaaf72c373b719014cbc261871a6089d3e9da2 100644 (file)
@@ -2613,6 +2613,11 @@ unsigned SelectionDAG::ComputeNumSignBits(SDValue Op, unsigned Depth) const{
     if (Tmp == 1) return 1;  // Early out.
     Tmp2 = ComputeNumSignBits(Op.getOperand(2), Depth+1);
     return std::min(Tmp, Tmp2);
+  case ISD::SELECT_CC:
+    Tmp = ComputeNumSignBits(Op.getOperand(2), Depth+1);
+    if (Tmp == 1) return 1;  // Early out.
+    Tmp2 = ComputeNumSignBits(Op.getOperand(3), Depth+1);
+    return std::min(Tmp, Tmp2);
   case ISD::SMIN:
   case ISD::SMAX:
   case ISD::UMIN: