[LLVMdev] Qs on building LLVM passes

Nick Lewycky nicholas at mxc.ca
Sat Jan 17 23:59:39 PST 2009


Keun Soo Yim wrote:
> 
> 
>  
> 
>  Hi,
> 
>  
> 
>  I have couple of questions that those who design unconventional passes 
> would be interested in.
> 
>  
> 
> 1.       How to move a virtual register data to another new virtual 
> register?
> 
> It seems like that there is no LLVM instruction similar to mov machine 
> instruction.
> 
> Arithmetic or logical operators could be used for integer variables
> 
> but what about pointer variables?

The trick to copying values is to use bitcast where the source and 
destination types are the same.

Of course, if you're doing this, you should understand that you're being 
very naughty indeed. :)

Nick

> 
>  
> 
> 2.       What is typically IR-level pass execution order? Especially 
> when we separately execute
> 
> the front-end, IR optimizer, and back-end, this information seems to be 
> needed.
> 
>  
> 
> 3.       In code generator, how can we add new instruction in a way that 
> back-end consider
> 
> this added instruction for its instruction scheduling and register 
> allocation?
> 
>  
> 
>  Thanks in advance.
> 
>  
> 
>  - Keun Soo
> 
>  
> 
>  
> 
>  
> 
>  
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




More information about the llvm-dev mailing list