[Mips] Make MipsBranchExpansion aware of BBIT family of branch
authorDjordje Todorovic <djordje.todorovic@syrmia.com>
Fri, 27 Mar 2020 08:11:48 +0000 (09:11 +0100)
committerDjordje Todorovic <djordje.todorovic@syrmia.com>
Tue, 31 Mar 2020 07:20:51 +0000 (09:20 +0200)
commitbcbd60aeb5fe20136fe79270ac1b8f3936883d78
tree1f3f8459934890363fa1fddd32b418599a0318b6
parentd2d6c9f59197bd82ec5bc9c003840f244a70a347
[Mips] Make MipsBranchExpansion aware of BBIT family of branch

Octeon branches (bbit0/bbit032/bbit1/bbit132) have an immediate operand,
so it is legal to have such replacement within
MipsBranchExpansion::replaceBranch().

According to the specification, a branch (e.g. bbit0 ) looks like:

bbit0  rs p offset  // p is an immediate operand
  if !rs<p> then branch

Without this patch, an assertion triggers in the method,
and the problem has been found in the real example.

Differential Revision: https://reviews.llvm.org/D76842
llvm/lib/Target/Mips/MipsBranchExpansion.cpp
llvm/lib/Target/Mips/MipsInstrInfo.h
llvm/lib/Target/Mips/MipsSEInstrInfo.cpp
llvm/lib/Target/Mips/MipsSEInstrInfo.h
llvm/test/CodeGen/Mips/longbranch/long-branch-octeon.ll [new file with mode: 0644]