[mips] Fix MipsLongBranch pass to work when the offset from the branch to the
authorSasa Stankovic <Sasa.Stankovic@imgtec.com>
Wed, 30 Apr 2014 15:06:25 +0000 (15:06 +0000)
committerSasa Stankovic <Sasa.Stankovic@imgtec.com>
Wed, 30 Apr 2014 15:06:25 +0000 (15:06 +0000)
commitfbe7448e5dabca17ee5407cba925cec465f5c04d
tree1cda57d328283061b07ca18e3b509af98e0ac073
parent99b44bacab50333bca5ae0df1142af38585c304b
[mips] Fix MipsLongBranch pass to work when the offset from the branch to the
target cannot be determined accurately. This is the case for NaCl where the
sandboxing instructions are added in MC layer, after the MipsLongBranch pass.
It is also the case when the code has inline assembly. Instead of calculating
offset in the MipsLongBranch pass, use %hi(sym1 - sym2) and %lo(sym1 - sym2)
expressions that are resolved during the fixup.

This patch also deletes microMIPS test file test/CodeGen/Mips/micromips-long-branch.ll
and implements microMIPS CHECKs in a much simpler way in a file
test/CodeGen/Mips/longbranch.ll, together with MIPS32 and MIPS64.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207656 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/Mips/Mips64InstrInfo.td
lib/Target/Mips/MipsAsmPrinter.cpp
lib/Target/Mips/MipsAsmPrinter.h
lib/Target/Mips/MipsInstrInfo.h
lib/Target/Mips/MipsInstrInfo.td
lib/Target/Mips/MipsLongBranch.cpp
lib/Target/Mips/MipsMCInstLower.cpp
lib/Target/Mips/MipsMCInstLower.h
test/CodeGen/Mips/longbranch.ll
test/CodeGen/Mips/micromips-long-branch.ll [deleted file]