[llvm-commits] [llvm] r141161 - /llvm/trunk/lib/Analysis/ScalarEvolution.cpp

Nick Lewycky nicholas at mxc.ca
Tue Oct 4 23:25:34 PDT 2011


On 10/04/2011 11:18 PM, Andrew Trick wrote:
> On Oct 4, 2011, at 11:10 PM, Nick Lewycky wrote:
>
>> On 10/04/2011 08:25 PM, Andrew Trick wrote:
>>> Author: atrick
>>> Date: Tue Oct  4 22:25:31 2011
>>> New Revision: 141161
>>>
>>> URL: http://llvm.org/viewvc/llvm-project?rev=141161&view=rev
>>> Log:
>>> Avoid exponential recursion in SCEV getConstantEvolvingPHI and EvaluateExpression.
>>>
>>> Note to compiler writers: never recurse on multiple instruction
>>> operands without memoization.
>>> Fixes rdar://10187945. Was taking 45s, now taking 5ms.
>>
>> Ugh. Sorry for adding this, I really didn't think this would be a problem in practice. Thanks for handling the fallout! Feel free to ask me to clean up my own performance problems too, if you like :)
>
>
> Now I know who it was... I think a fair penalty would be to find any other places where we make recursive calls on operands or use lists without a visited set. After all, they're fun to fix.
>
> Incidentally, you'll see my fix is nicely compatible with your proposed patch to the same code.

Wait, proposed patch? Doh! This is the code I *haven't* committed the 
patch for yet! Never mind, forget I said anything :)

And yes, this dovetails nicely with my proposed patch, so I suppose I 
should get on merging. :)

Nick



More information about the llvm-commits mailing list