[llvm-commits] [llvm] r155616 - in /llvm/trunk: lib/Transforms/Scalar/Reassociate.cpp test/Transforms/Reassociate/mulfactor.ll

Duncan Sands baldrick at free.fr
Sun Sep 30 10:28:16 PDT 2012


Hi Chris,

>> URL: http://llvm.org/viewvc/llvm-project?rev=155616&view=rev
>> Log:
>> Teach the reassociate pass to fold chains of multiplies with repeated
>> elements to minimize the number of multiplies required to compute the
>> final result. This uses a heuristic to attempt to form near-optimal
>> binary exponentiation-style multiply chains. While there are some cases
>> it misses, it seems to at least a decent job on a very diverse range of
>> inputs.
>>
>> Initial benchmarks show no interesting regressions, and an 8%
>> improvement on SPASS. Let me know if any other interesting results (in
>> either direction) crop up!
>
> Very cool.  Did you guys consider extending llvm.powi to work on integers?  It seems cleaner for reassociate to fold repeated multiplication changes into a powi, and then have codegen do the optimal expansion for both floats and integers.

yes, it's on my list of things to do (it's a long list though).

Ciao, Duncan.




More information about the llvm-commits mailing list