This is an archive of the discontinued LLVM Phabricator instance.

[NVPTX] enable NaryReassociate in NVPTX
ClosedPublic

Authored by jingyue on Apr 16 2015, 6:58 PM.

Details

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

Diff Detail

Event Timeline

jingyue updated this revision to Diff 23891.Apr 16 2015, 6:58 PM
jingyue retitled this revision from to [NVPTX] enable NaryReassociate in NVPTX.
jingyue updated this object.
jingyue edited the test plan for this revision. (Show Details)
jingyue added reviewers: eliben, jholewinski.
jingyue added a subscriber: Unknown Object (MLST).
eliben accepted this revision.Apr 17 2015, 9:25 AM
eliben edited edge metadata.

LGTM

This revision is now accepted and ready to land.Apr 17 2015, 9:25 AM
jingyue updated this revision to Diff 24341.Apr 23 2015, 4:27 PM
jingyue edited edge metadata.

rebase to trunk

jingyue closed this revision.Apr 23 2015, 7:57 PM