[PATCH] D48019: [mips] Handle branch expansion corner cases

Aleksandar Beserminji via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 11 05:54:57 PDT 2018


abeserminji created this revision.
abeserminji added reviewers: petarj, sdardis.
Herald added subscribers: atanasyan, arichardson, dschuff.

With this patch, it is calculated if potential **jump** instruction and target are in the same segment.
If so, **jump** instruction with immediate field is used.

Also, branch expansion does not cover cases where offset does not fit immediate value of a bc/j instructions.
With this patch, offset is stored into registers, and then **jump register** instruction is used.


Repository:
  rL LLVM

https://reviews.llvm.org/D48019

Files:
  lib/Target/Mips/MipsBranchExpansion.cpp
  lib/Target/Mips/MipsInstrInfo.cpp
  test/CodeGen/Mips/longbranch/long-branch-expansion-1.ll
  test/CodeGen/Mips/longbranch/long-branch-expansion-2.ll
  test/CodeGen/Mips/longbranch/long-branch-expansion-3.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48019.150698.patch
Type: text/x-patch
Size: 16461 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180611/5673872c/attachment.bin>


More information about the llvm-commits mailing list