Re: [PATCH] D12719: ScalarEvolution assume hanging bugfix

2015-09-09 Thread Sanjoy Das via cfe-commits
sanjoy added a comment. I don't think this is an infinite loop (Piotr, can you please verify this?), it is probably an O(n!) recursion where n == number of the assumptions. ScalarEvolution::isImpliedCond already guards for infinite loops via MarkPendingLoopPredicate. However, if you have assume

Re: [PATCH] D12719: ScalarEvolution assume hanging bugfix

2015-09-09 Thread Sanjoy Das via cfe-commits
> 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 u

Re: [PATCH] D12719: ScalarEvolution assume hanging bugfix

2015-09-08 Thread Piotr Padlewski via cfe-commits
Prazek added a comment. I used "hanging out" in the meaning of being very slow, not sure if it is right word for it. http://reviews.llvm.org/D12719 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listin

Re: [PATCH] D12719: ScalarEvolution assume hanging bugfix

2015-09-08 Thread Piotr Padlewski via cfe-commits
Prazek added a comment. I checked it, it is of course not infinite. I am not sure about n! in case of assumes. I having 10 or 20 assumes will not make it slow. @rsmith was helping me with it, and he thinks that for assumes it is O(n^2), because results are memorized. So it this case, 1000 assu

Re: [PATCH] D12719: ScalarEvolution assume hanging bugfix

2015-09-08 Thread Nick Lewycky via cfe-commits
On 8 September 2015 at 20:27, Sanjoy Das wrote: > sanjoy added a comment. > > I don't think this is an infinite loop (Piotr, can you please verify > this?), it is probably an O(n!) recursion where n == number of the > assumptions. > > ScalarEvolution::isImpliedCond already guards for infinite loo

Re: [PATCH] D12719: ScalarEvolution assume hanging bugfix

2015-09-08 Thread Nick Lewycky via cfe-commits
nlewycky added inline comments. Comment at: lib/Analysis/ScalarEvolution.cpp:6980 @@ -6991,1 +6979,3 @@ + // Check conditions due to any @llvm.assume intrinsics. + for (auto &AssumeVH : AC.assumptions()) { Prazek wrote: > nlewycky wrote: > > What is it about t

Re: [PATCH] D12719: ScalarEvolution assume hanging bugfix

2015-09-08 Thread Piotr Padlewski via cfe-commits
Prazek added inline comments. Comment at: lib/Analysis/ScalarEvolution.cpp:6980 @@ -6991,1 +6979,3 @@ + // Check conditions due to any @llvm.assume intrinsics. + for (auto &AssumeVH : AC.assumptions()) { nlewycky wrote: > What is it about this check which is a

Re: [PATCH] D12719: ScalarEvolution assume hanging bugfix

2015-09-08 Thread Nick Lewycky via cfe-commits
nlewycky added inline comments. Comment at: lib/Analysis/ScalarEvolution.cpp:6980 @@ -6991,1 +6979,3 @@ + // Check conditions due to any @llvm.assume intrinsics. + for (auto &AssumeVH : AC.assumptions()) { What is it about this check which is a problem? Or put

[PATCH] D12719: ScalarEvolution assume hanging bugfix

2015-09-08 Thread Piotr Padlewski via cfe-commits
Prazek created this revision. Prazek added reviewers: rsmith, nlewycky. Prazek added a subscriber: cfe-commits. Herald added a subscriber: sanjoy. http://reviews.llvm.org/D12719 Files: lib/Analysis/ScalarEvolution.cpp test/Analysis/ScalarEvolution/avoid-assume-hang.ll Index: test/Analysis/Sc