Jingyue Wu
|
3daace5295
|
[NVPTX] enable NaryReassociate in NVPTX
Summary:
We run NaryReassociate right after SLSR because SLSR enables many
opportunities for NaryReassociate. For example, in nary-slsr.ll
foo((a + b) + c);
foo((a + b * 2) + c);
foo((a + b * 3) + c); // 2 muls and 6 adds
after SLSR:
ab = a + b;
foo(ab + c);
ab2 = ab + b;
foo(ab2 + c);
ab3 = ab2 + b;
foo(ab3 + c); // 6 adds
after NaryReassociate:
abc = (a + b) + c;
foo(abc);
ab2c = abc + b;
foo(ab2c);
ab3c = ab2c + b;
foo(ab3c); // 4 adds
Test Plan: nary-slsr.ll
Reviewers: jholewinski, eliben
Reviewed By: eliben
Subscribers: jholewinski, llvm-commits
Differential Revision: http://reviews.llvm.org/D9066
llvm-svn: 235688
|
2015-04-24 02:54:06 +00:00 |