[LLVMdev] LLVM and Interrupt Service Routines.

Chris Lattner clattner at apple.com
Sun Jul 26 10:39:13 PDT 2009

On Jul 26, 2009, at 3:42 AM, Sanjiv Gupta wrote:

>> What happens with functions that are called both inside and outside
>> ISR context? Do you have to codegen two copies of those?
> Yes. That's precisely what we are trying to achieve in llvm-ld.
> But the problems don't end there, as llvm-ld doesn't have any idea of
> libcalls (they're generated in llc) and they could also be called from
> both places.

If you have to generate two copies of the function with different  
entrypoints, the *front-end* should handle the duplication.  This is  
just like C++ constructors.

One really old patch that apple guys experimented in the past was a  
"slow and fast call" attribute, which you could stick on function  
declarations.  If you added it to a function, the frontend would  
generate an entry point with a standard calling convention as well as  
one with a faster in-register ABI.  Direct calls would use the fast  
entry point, but if you took the address, you'd get the address of the  
normal one.

All of this was handled by the front-end, and works fine.  I think the  
patch eventually got ripped out of the compiler for other reasons  


More information about the llvm-dev mailing list