[PATCH] D16404: [X86] Use hash table in LEA optimization pass
Andrey Turetskiy via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 21 06:29:45 PST 2016
aturetsk added a comment.
As Daniel suggested in https://llvm.org/bugs/show_bug.cgi?id=25843 I added a hash table to store LEAs to search for them faster in removeRedundantLEAs and removeRedundantAddrCalc.
I used the same test from the bug as in http://reviews.llvm.org/D15692, but with -Oz option (to enable the pass fully).
Here are the results:
Without LEA pass:
none$ time ./bin/clang++ -std=c++11 -S test-oz.ll -Oz -mllvm -disable-x86-lea-opt
real 0m8.491s
user 0m8.437s
sys 0m0.052s
With old LEA pass:
none$ time ./bin/clang++ -std=c++11 -S test-oz.ll -Oz -mllvm -enable-x86-lea-opt
real 0m8.878s
user 0m8.819s
sys 0m0.051s
With new LEA pass (no need to pass -enable-lea-opt any more):
none$ time ./bin/clang++ -std=c++11 -S test-oz.ll -Oz
real 0m8.546s
user 0m8.493s
sys 0m0.051s
The difference for the current example is small, but visible. I think for the cases mentioned in the bug it will be more noticeable.
http://reviews.llvm.org/D16404
More information about the llvm-commits
mailing list