[LLVMdev] Adding a halting function attribute?

Duncan Sands baldrick at free.fr
Sun May 2 01:33:24 PDT 2010


>> 1) You have to prove that infinite recursion (which might be tail calls) doesn't happen.  This means that anything that does an indirect call has to be assumed to not be halting.
>>
>> 2) You'd have to update all the builtins to say they are halting, because they are external functions.
>>
>> 3) This adds (even more) clutter to the IR. :(
>
> On reflection, perhaps this isn't so bad.  This really only matters when the compiler is able to infer readnone/readonly, which typically doesn't include cases with indirect calls.  Per #2, I think it could be handled by making the GCC-style pure/const attributes imply both readonly/readnone *and* halting.

Heh - I was just about to make these points myself :)

Ciao,

Duncan.



More information about the llvm-dev mailing list