Here is the patch for the new Operator Strength Reduction optimization
pass that I have written. The bulk of the code is in
The optimization is based on the algorithm described within the paper
that can be found here:
Keith D. Cooper , L. Taylor Simpson , Christopher A. Vick, Operator
strength reduction, ACM Transactions on Programming Languages and
Systems (TOPLAS), v.23 n.5, p.603-625, September 2001.
I have embedded the paper's pseudo code into comment blocks within the code.
The algorithm finds reduction opportunities in both array accesses and
explicit multiplications within loops.
Next, I plan on writing the regression tests.
Brian West <bnwest <at> rice.edu> writes:
I am currently writing a new optimization pass for LLVM, based on the
paper Operator Strength Reduction (Taylor Simpson et al, 2001). I
noticed from the Developer Policy page that my code will need to be
reviewed before it is committed to the trunk.
The Policy page also indicated that all "major" changes should to be
announced before coding and should be done as a series of incremental
changes. I am not sure a new stand alone optimization pass counts as a
major change or not.
I have run my pass against the test suite (as described here: "How to
test my pass"
have fixed all of the compilation errors and all but one of the
I have made a pass over my code to conform to the LLVM coding standards.
I have not written the regressions tests yet.
I also still need to work on the performance, but as is it is faster
than the existing -loop-reduce pass.
My question is how to proceed. What steps do I need to take to get my
code reviewed and committed to the trunk?
Duncan Sands <baldrick <at> free.fr> writes:
osr.patch (79.4 KB)