]> granicus.if.org Git - llvm/commit
[mips] Fix JmpLink to texternalsym and tglobaladdr on mcroMIPS R6
authorSimon Atanasyan <simon@atanasyan.com>
Fri, 12 Jul 2019 04:58:45 +0000 (04:58 +0000)
committerSimon Atanasyan <simon@atanasyan.com>
Fri, 12 Jul 2019 04:58:45 +0000 (04:58 +0000)
commit9c924b4d86a4fcc02276ffe2761f5771efd956c4
treea5f4ea01ae11d2ebba90595c8d482bcfb2327be4
parentd6a4ded922547d20fbdcce77138b70b87d867513
[mips] Fix JmpLink to texternalsym and tglobaladdr on mcroMIPS R6

There is not match for the `MipsJmpLink texternalsym` and `MipsJmpLink
tglobaladdr` patterns for microMIPS R6. 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.

Differential Revision: https://reviews.llvm.org/D64552

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365870 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/Mips/MicroMips32r6InstrInfo.td
lib/Target/Mips/MipsScheduleGeneric.td
test/CodeGen/Mips/llvm-ir/fptosi.ll
test/CodeGen/Mips/micromips-delay-slot.ll
test/CodeGen/Mips/micromips-target-external-symbol-reloc.ll
test/CodeGen/Mips/tailcall/tailcall.ll