[llvm-commits] [cfe-commits] [PATCH][Review Request] EarlyCSE stack overflow - bugzilla 11794

Jakub Staszak kubastaszak at gmail.com
Wed Jan 18 16:23:50 PST 2012


I think that std::vector (instead of stack) can save some compilation time here, because it is included anyway.

- Kuba

On Jan 18, 2012, at 10:57 PM, Lenny Maiorani wrote:

> 
> On Jan 18, 2012, at 2:34 PM, Eli Friedman wrote:
> 
>> On Wed, Jan 18, 2012 at 1:25 PM, Lenny Maiorani <lenny at colorado.edu> wrote:
>>> Hi,
>>> 
>>> I found a stack overflow in EarlyCSE caused by recursion when provided a very large function. More information in bugzilla - http://llvm.org/bugs/show_bug.cgi?id=11794
>>> 
>>> Attached is a patch. Please review and I will commit once it is approved.
>>> 
>>> The patch simply changes the algorithm from being a recursive pre-order depth-first traversal to the same traversal, but using a list as a stack of nodes to process.
>> 
>> The idea looks like it's in the right direction. We generally try to avoid
>> std::list in LLVM; see
>> http://llvm.org/docs/ProgrammersManual.html#ds_sequential .
>> 
>> In the future, please don't send patches that don't touch
>> clang-specific code to cfe-commits.
>> 
>> -Eli
> 
> Hi Eli,
> 
> The reason I chose to use std::list here is that it supports splice. Perhaps a std::stack implementation is preferred here?
> 
> Attached is a patch implementing that...
> 
> -Lenny
> 
> <earlycse-stack.diff>
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits





More information about the llvm-commits mailing list