[PATCH] D53366: [mips][micromips] Add pattern for JmpLink to TargetExternalSymbol

Simon Dardis via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 22 13:06:11 PDT 2018


sdardis added inline comments.


================
Comment at: lib/Target/Mips/MicroMipsInstrInfo.td:1454
                     ISA_MICROMIPS32R5, ASE_VIRT;
+def : MipsPat<(MipsJmpLink (i32 texternalsym:$dst)),
+              (JAL_MM texternalsym:$dst)>, ISA_MICROMIPS32_NOT_MIPS32R6;
----------------
This is in the wrong place. It should proceed the tail call patterns on line 1274.


================
Comment at: test/CodeGen/Mips/micromips-target-external-symbol-reloc.ll:1
+; RUN: llc -mtriple=mips-mti-linux-gnu -mcpu=mips32r2 -mattr=+micromips -filetype=obj < %s | llvm-objdump -D -r - | FileCheck %s
+
----------------
This test can be made better by declaring an external function f rather than memset as the memset intrinsic could be expanded inline by the MIPS backend in the future in any number of ways, e.g. lwm/swm in a loop for O3.

Another thing is that the test can be quicker by stopping after the isel expand pseudos pass and checking for the presence of JAL_MM, rather than assemblying an object then disassembling it. Another approach would be to extend test/CodeGen/Mips/llvm-ir/isel.ll for this case.


Repository:
  rL LLVM

https://reviews.llvm.org/D53366





More information about the llvm-commits mailing list