ADD / SUB / SMUL / UMUL with overflow second result top bits must be zero.
authorEvan Cheng <evan.cheng@apple.com>
Mon, 2 Feb 2009 09:15:04 +0000 (09:15 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Mon, 2 Feb 2009 09:15:04 +0000 (09:15 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63509 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86ISelLowering.cpp

index 846acd02197949cbbe90e685181d2e686c7e55cd..7a4d34d10a4db0654aa7696ad2c411b38f128c0e 100644 (file)
@@ -7515,6 +7515,14 @@ void X86TargetLowering::computeMaskedBitsForTargetNode(const SDValue Op,
   KnownZero = KnownOne = APInt(Mask.getBitWidth(), 0);   // Don't know anything.
   switch (Opc) {
   default: break;
+  case X86ISD::ADD:
+  case X86ISD::SUB:
+  case X86ISD::SMUL:
+  case X86ISD::UMUL:
+    // These nodes' second result is a boolean.
+    if (Op.getResNo() == 0)
+      break;
+    // Fallthrough
   case X86ISD::SETCC:
     KnownZero |= APInt::getHighBitsSet(Mask.getBitWidth(),
                                        Mask.getBitWidth() - 1);