[PATCH] D64552: [mips] Fix JmpLink to texternalsym and tglobaladdr on mcroMIPS R6

Simon Atanasyan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 11 03:13:12 PDT 2019


atanasyan created this revision.
atanasyan added reviewers: Petar.Avramovic, sdardis.
Herald added subscribers: jrtc27, hiraditya, arichardson.
Herald added a project: LLVM.

There is not match for the `MipsJmpLink texternalsym` and `MipsJmpLink tglobaladdr` patterns for microMIPS R6 <https://reviews.llvm.org/source/compiler-rt/>. As a result LLVM incorrectly selects the `JALRC16` compact 2-byte instruction which takes a target instruction address from a register only and assign `R_MIPS_32` relocation for this instruction. This relocation completely overwrites `JALRC16` and nearby instructions.

This patch adds missed matching patterns, selects `BALC` instruction and assign a correct `R_MICROMIPS_PC26_S1` relocation.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D64552

Files:
  llvm/lib/Target/Mips/MicroMips32r6InstrInfo.td
  llvm/lib/Target/Mips/MipsScheduleGeneric.td
  llvm/test/CodeGen/Mips/llvm-ir/fptosi.ll
  llvm/test/CodeGen/Mips/micromips-delay-slot.ll
  llvm/test/CodeGen/Mips/micromips-target-external-symbol-reloc.ll
  llvm/test/CodeGen/Mips/tailcall/tailcall.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64552.209157.patch
Type: text/x-patch
Size: 6335 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190711/0c671e85/attachment.bin>


More information about the llvm-commits mailing list