[LLVMdev] how to eliminate dead infinite loops?

Andrew Clinton andrew at sidefx.com
Fri Nov 26 14:54:37 PST 2010


On 11/26/2010 05:40 PM, Nick Lewycky wrote:
>
> I called it "halting":
>
>
> http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20100705/103670.html 
>
>
> but it turns out that making it efficient at compile time and make the 
> optimizers make use of it is very tricky. In short, we want to be able 
> to automatically deduce that a function is halting (as well as 
> permitting labelling by the frontend which is easy) and that deduction 
> requires a FunctionPass but the user of the information is a 
> CallGraphSCCPass and you can't have CGSCC passes depending on function 
> passes. So, it's blocked on changes to the pass manager to make this 
> possible.

That looks good.  I guess my 2 cents are then that it would still be 
useful to have this Halting attribute even if it can't be automatically 
deduced, since often the front end will know whether the function should 
be treated as halting and can label it accordingly.  Function attributes 
are not strict, correct?  So you could have functions that halt but 
without the halting attribute, and still rely on correct optimization 
behavior.



More information about the llvm-dev mailing list