OSDN Git Service

[mips] Fix local dynamic TLS with Sym64
authorSimon Atanasyan <simon@atanasyan.com>
Tue, 24 Jul 2018 13:47:52 +0000 (13:47 +0000)
committerSimon Atanasyan <simon@atanasyan.com>
Tue, 24 Jul 2018 13:47:52 +0000 (13:47 +0000)
commitdab9d81b7c2c582530aae98fd5b433379445d2c9
tree27aadf28e2d93ddf5d696595770bbdc490be8ffc
parentab7df71889e216cb15769ab40fa69afaca01ed2e
[mips] Fix local dynamic TLS with Sym64

For the final DTPREL addition, rather than a lui/daddiu/daddu triple,
LLVM was erronously emitting a daddiu/daddiu pair, treating the %dtprel_hi
as if it were a %dtprel_lo, since Mips::Hi expands unshifted for Sym64.
Instead, use a new TlsHi node and, although unnecessary due to the exact
structure of the nodes emitted, use TlsHi for local exec too to prevent
future bugs. Also garbage-collect the unused TprelLo and TlsGd nodes,
and TprelHi since its functionality is provided by the new common TlsHi node.

Patch by James Clarke.

Differential revision: https://reviews.llvm.org/D49259

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337827 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/Mips/MicroMipsInstrInfo.td
lib/Target/Mips/Mips16InstrInfo.td
lib/Target/Mips/Mips64InstrInfo.td
lib/Target/Mips/MipsISelLowering.cpp
lib/Target/Mips/MipsISelLowering.h
lib/Target/Mips/MipsInstrInfo.td
test/CodeGen/Mips/tls.ll