This is an archive of the discontinued LLVM Phabricator instance.

[mips] [IAS] Do not generate redundant move when expanding lw/sw with symbol.
ClosedPublic

Authored by tomatabacu on Mar 4 2015, 2:12 AM.

Details

Summary

Even though there is no 2nd register operand in the "lw/sw $8, symbol" case, we still try to find one,
and we end up with $0, which makes us generate an unnecessary "addu $8, $8, $0" (a.k.a. "move $8, $8").

We can avoid this by checking if the 2nd register operand is different from $0, before generating the addu.

Diff Detail

Event Timeline

tomatabacu updated this revision to Diff 21181.Mar 4 2015, 2:12 AM
tomatabacu retitled this revision from to [mips] [IAS] Do not generate redundant move when expanding lw/sw with symbol..
tomatabacu updated this object.
tomatabacu edited the test plan for this revision. (Show Details)
tomatabacu added a reviewer: dsanders.
tomatabacu added a subscriber: Unknown Object (MLST).
dsanders accepted this revision.Apr 7 2015, 3:39 AM
dsanders edited edge metadata.

LGTM

This revision is now accepted and ready to land.Apr 7 2015, 3:39 AM
tomatabacu closed this revision.Apr 8 2015, 6:55 AM