[LLVMdev] metadata to inform the optimizers that some code should stay unchanged

Devang Patel dpatel at apple.com
Tue Mar 1 10:44:10 PST 2011


On Mar 1, 2011, at 2:10 AM, Xinfinity wrote:

> 
> 
> Hello LLVM,
> 
> I am working on some passes that perform code transformations. Since I am
> interested in performance, I apply the O3 passes, right after my pass.
> However, the optimization passes modify the code inserted by my pass in an
> undesirable way. As far I know, there is no way to prevent the optimizers
> from optimizing some regions of code. So what I intend to do is to attach
> metadata to the instructions contained in basicblocks that I want to remain
> unchanged, and to modify some of the optimization passes to be aware of the
> metadata.

IMO, this is not the right way to go.

> For now, I am interested only in passes that would affect the
> control flow graph, so for a start I modify the Simplify CFG pass and the
> jump threading pass, but I will check which other passes might duplicate the
> code, merge blocks etc.
> 
> Do you think the performance will drop significantly if some regions of code
> are not optimized ?
> And do you consider this modification would be of any
> use to the community?
> 
> Thank you.
> Alexandra
> 
> -- 
> View this message in context: http://old.nabble.com/metadata-to-inform-the-optimizers-that-some-code-should-stay-unchanged-tp31039471p31039471.html
> Sent from the LLVM - Dev mailing list archive at Nabble.com.
> 
> _______________________________________________
> 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