[LLVMdev] jump to function

Dale Johannesen dalej at apple.com
Wed May 20 14:34:09 PDT 2009


On May 20, 2009, at 2:22 PMPDT, dan mihai wrote:

> Hello,
>
> Is it possible to jump from one function to the beginning of another  
> function?

This can't be represented in llvm IR (or in standard C/C++).  An  
optimization called (in LLVM) "tail call" will generate this at the  
assembly level, but not all back ends have this implemented.

> For instance, assume wrapper_FOO is a wrapper for FOO. I replace the  
> code
> ..............................
> bar() {
>  FOO(...)
> }
> ..............................
> with
> ..............................
> bar() {
>   wrapper_FOO(...)
> }
> ..............................
>
> Now, for efficiency, I'd like to have
> wrapper_FOO() {
>   <do some work>
>   jump FOO;
> }
>
> Thank you,
> Dan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090520/e6a62892/attachment.html>


More information about the llvm-dev mailing list