SSAPRE for LLVM

i wish to develop llvm SSAPRE compiler optimization for my engineering academic project .for,that i have a sample c++ program and its .ll file.anyone have SSAPRE implementation in c++. if anyone have, please give me that implementation immediately.

joseykollam@gmail.com

josey @ 9895685353
elw technologies
cochin

i wish to develop llvm SSAPRE compiler optimization for my engineering
academic project .for,that i have a sample c++ program and its .ll
file.anyone have SSAPRE implementation in c++. if anyone have, please give
me that implementation immediately.

In the old version of LLVM, the GVN pass also does PRE. But by
default, PRE is not on. We need to set -gvnpre to make it work. ''opt
--help'' will list all flags for optimizations. I am not sure if the
latest LLVM still has the flag.

GVN performs PRE, but covers only the “diamond” case, i.e. it only hoists expressions to immediate predecessor blocks in order to avoid an increase in live ranges, and only does so when there is no increase in code size.

From what I know, previously there was SSAPRE in LLVM but it was removed because SSAPRE caused code bloat and the benefit of redundancy elimination didn’t make up for that.

Josey: I attempted some months ago to implement an actual PRE pass using GVN that covers more general cases using path profiling and a heuristic to only eliminate redundancies when really worthy, but didn’t get to finish yet. Would you be interested in knowing more about it?