From: Simon Pilgrim Date: Fri, 28 Oct 2016 14:07:44 +0000 (+0000) Subject: [SelectionDAG] computeKnownBits - early-out if any BUILD_VECTOR element has no known... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=734d68c70ed942c3b5757358646c634f3bae39bc;p=llvm [SelectionDAG] computeKnownBits - early-out if any BUILD_VECTOR element has no known bits No need to check the remaining elements - no common known bits are available. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285399 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index e6b8d2f5ade..db6accfb628 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -2042,6 +2042,10 @@ void SelectionDAG::computeKnownBits(SDValue Op, APInt &KnownZero, // TODO: support per-element known bits. KnownOne &= KnownOne2; KnownZero &= KnownZero2; + + // If we don't know any bits, early out. + if (!KnownOne && !KnownZero) + break; } break; case ISD::AND: