[LLVMdev] if-conversion

John Criswell criswell at cs.uiuc.edu
Tue Jan 20 12:51:07 PST 2009


Ralf Karrenberg wrote:
>> If you write a separate pass, we'd like to integrate it in mainline
>> llvm sources.
>>     
>
> Thank you for your answers. I will do my best to develop something which 
> could be useful for more people :).
>   
If you're looking for sources on how to do if-conversion, there's an
algorithm for it in the book "Optimizing Compilers for Modern
Architectures," Chapter 7.  That algorithm, in turn, relies upon
computing control dependence.  There's an algorithm for computing that
in the same chapter, and there's another algorithm for control
dependence in the following paper:

http://portal.acm.org/citation.cfm?id=115372.115320&coll=portal&dl=ACM&CFID=18980569&CFTOKEN=50678055

My recommendation is to write two passes: one that computes control
dependence and another that performs if-conversion.  A
control-dependence analysis pass is useful for other analysis and
transform passes.

-- John T.

> Cheers,
> Ralf 
>
> _______________________________________________
> 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