[PATCH] [mips] Manually replace JAL pseudo-instructions with their JALR equivalent, instead of using InstAlias.

Toma Tabacu toma.tabacu at imgtec.com
Fri Oct 3 08:36:32 PDT 2014


Hi dsanders,

This is needed for an upcoming patch which implements 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.

http://reviews.llvm.org/D5601

Files:
  lib/Target/Mips/AsmParser/MipsAsmParser.cpp
  lib/Target/Mips/MipsInstrInfo.td
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D5601.14380.patch
Type: text/x-patch
Size: 3882 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141003/abb2bb23/attachment.bin>


More information about the llvm-commits mailing list