[PATCH] D12719: ScalarEvolution assume hanging bugfix

Sanjoy Das via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 8 21:05:43 PDT 2015


> Both tests are protected by there being exactly one latch in the loop (we
> exit early if there's not one latch). I'm not sure what makes the
> LoopContinuePredicate check safer?

You can have a loop with a single latch but an arbitrary number of
assumes (= n).  In such a loop, you'll still end up calling
isImpliedCond O(n!) times because of the assumes (and the guard
on there being only one latch won't help).

OTOH if the loop has multiple latches = m > 1, then we exit early we
won't recurse at all, we'll just bail early from
isLoopBackedgeGuardedByCond because of the check you mention (not
ideal, but safe).

-- Sanjoy


More information about the cfe-commits mailing list