[LLVMdev] readonly and infinite loops

Nuno Lopes nunoplopes at sapo.pt
Sun Jun 28 14:39:44 PDT 2015


>> People have been aware of this issue for a long time (as you can see
>> by
>> Nick's 2010 patch).  I guess it was not pushed further because of
>> lack of
>> practical interest.
>
> I can't comment about the rationale in 2010, but this came up again when I 
> was originally working on heap-to-stack conversion. Being able to mark 
> functions as halting is essential for doing heap-to-stack conversion. This 
> was put on hold, however, essentially awaiting the new pass manager. The 
> issue is that you'd like to be able to use SCEV in a module/CGSCC-level 
> pass to infer the attribute on functions with loops, and this cannot be 
> done directly until we have the new pass manager.

Interesting.  Could you give an example why knowing a function will halt is 
essential for the heap-to-stack conversion?  It's definitely an optimization 
we should be doing (although, correct me if I'm wrong, LLVM already has some 
form of this for very small mallocs, no?)

Thanks,
Nuno 




More information about the llvm-dev mailing list