[mips] [IAS] Do not generate redundant move when expanding lw/sw with symbol.
authorToma Tabacu <toma.tabacu@imgtec.com>
Wed, 8 Apr 2015 13:52:41 +0000 (13:52 +0000)
committerToma Tabacu <toma.tabacu@imgtec.com>
Wed, 8 Apr 2015 13:52:41 +0000 (13:52 +0000)
commitc6ce0749adccadedec14de35f50dbca82c089797
tree60e9c5278fa54188b8cd701c81350fb7425fcb93
parent3a10e8012b6269fad68dacb6904322328e33c3cb
[mips] [IAS] Do not generate redundant move when expanding lw/sw with symbol.

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.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D8055

llvm-svn: 234406
llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
llvm/test/MC/Mips/mips-expansions.s