[mips] Manually replace JAL pseudo-instructions with their JALR equivalent, instead...
authorToma Tabacu <toma.tabacu@imgtec.com>
Fri, 30 Jan 2015 11:18:50 +0000 (11:18 +0000)
committerToma Tabacu <toma.tabacu@imgtec.com>
Fri, 30 Jan 2015 11:18:50 +0000 (11:18 +0000)
commit71dc8ece4fc97f0830e300829d6b9cd4ac0589ec
treeb3b872888da56c097f8fd3e527bd1808fef37490
parent8cf149dbadda7bff3e96b2e8db42397c4f94356b
[mips] Manually replace JAL pseudo-instructions with their JALR equivalent, instead of using InstAlias.

Summary:
This is needed by the .cprestore assembler directive.

This directive needs to be able to insert an LW instruction after every JALR replacement of a JAL pseudo-instruction
(and never after a JALR which has NOT been a result of a pseudo-instruction replacement).

The problem with using InstAlias for these is that after it replaces the pseudo-instruction, we can't find out if the resulting JALR instruction
was generated by an InstAlias or not, so we don't know whether or not to insert our LW instruction.

By replacing it manually, we know when the pseudo-instruction replacement happens and we can insert the LW instruction correctly.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: emaste, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227568 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/Mips/AsmParser/MipsAsmParser.cpp
lib/Target/Mips/MipsInstrInfo.td
test/MC/Mips/micromips-jump-instructions.s