From: Davide Italiano Date: Wed, 9 Aug 2017 16:06:54 +0000 (+0000) Subject: [ValueTracking] Turn a test into an assertion. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=085d544d52e18e9b8208d78bf55709e4bce59dd1;p=llvm [ValueTracking] Turn a test into an assertion. As discussed with Chad, this should never happen, but this assertion is basically free, so, keep it around just in case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310493 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/ValueTracking.cpp b/lib/Analysis/ValueTracking.cpp index 995b3e0c6de..b81bf9ec9d1 100644 --- a/lib/Analysis/ValueTracking.cpp +++ b/lib/Analysis/ValueTracking.cpp @@ -4531,9 +4531,7 @@ static Optional isImpliedCondAndOr(const BinaryOperator *LHS, LHS->getOpcode() == Instruction::Or) && "Expected LHS to be 'and' or 'or'."); - // The remaining tests are all recursive, so bail out if we hit the limit. - if (Depth == MaxDepth) - return None; + assert(Depth <= MaxDepth && "Hit recursion limit"); // If the result of an 'or' is false, then we know both legs of the 'or' are // false. Similarly, if the result of an 'and' is true, then we know both