[LLVMdev] eliminate phi nodes, reduce unnecessary loads / stores , reg2mem, mem2reg

Jimborean Alexandra xinfinity_a at yahoo.com
Tue May 17 07:09:33 PDT 2011


Hi,

I work on a pass that requires as input LLVM code without any phi nodes. For 
this, I use the reg2mem pass which produces suitable code, the pass runs 
correctly, but I obtain a significant performance decrease. I expect that this 
is because there are more reads / writes to memory after running the reg2mem 
pass.
How can I optimize the code, without inserting any phi nodes? Or is there a 
better solution to eliminate the phi nodes in the first place?

The solution that comes to my mind is to run a custom version of the mem2reg 
pass. That would mean, after running the reg2mem pass, to eliminate unnecessary 
load / store instructions, if this can be done without inserting any phi nodes. 


Do you think this can be achieved and is it the right way to go?

Thank you,
Alexandra
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110517/069ca256/attachment.html>


More information about the llvm-dev mailing list