From 89e8a17b4d1945a6f4ab5de8448767fb483503aa Mon Sep 17 00:00:00 2001 From: Bill Schmidt Date: Wed, 4 Feb 2015 05:51:56 +0000 Subject: [PATCH] [PowerPC] Handle 32-bit targets properly in PPCTLSDynamicCall.cpp git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228116 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/PowerPC/PPCTLSDynamicCall.cpp | 4 +++- test/CodeGen/PowerPC/tls-pic.ll | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/Target/PowerPC/PPCTLSDynamicCall.cpp b/lib/Target/PowerPC/PPCTLSDynamicCall.cpp index b0e1dfa52a4..1b74c4e76e7 100644 --- a/lib/Target/PowerPC/PPCTLSDynamicCall.cpp +++ b/lib/Target/PowerPC/PPCTLSDynamicCall.cpp @@ -56,7 +56,9 @@ protected: MachineInstr *MI = I; if (MI->getOpcode() != PPC::GETtlsADDR && - MI->getOpcode() != PPC::GETtlsldADDR) + MI->getOpcode() != PPC::GETtlsldADDR && + MI->getOpcode() != PPC::GETtlsADDR32 && + MI->getOpcode() != PPC::GETtlsldADDR32) continue; DEBUG(dbgs() << "TLS Dynamic Call Fixup:\n " << *MI;); diff --git a/test/CodeGen/PowerPC/tls-pic.ll b/test/CodeGen/PowerPC/tls-pic.ll index b6782142c7f..549cd1927a7 100644 --- a/test/CodeGen/PowerPC/tls-pic.ll +++ b/test/CodeGen/PowerPC/tls-pic.ll @@ -25,12 +25,12 @@ entry: ; OPT0: addis [[REG2:[0-9]+]], 3, a@dtprel@ha ; OPT0: addi {{[0-9]+}}, [[REG2]], a@dtprel@l ; OPT0-32-LABEL: main -; OPT0-32: addi {{[0-9]+}}, {{[0-9]+}}, a@got@tlsld +; OPT0-32: addi 3, {{[0-9]+}}, a@got@tlsld ; OPT0-32: bl __tls_get_addr(a@tlsld)@PLT ; OPT0-32: addis [[REG:[0-9]+]], 3, a@dtprel@ha ; OPT0-32: addi {{[0-9]+}}, [[REG]], a@dtprel@l ; OPT1-32-LABEL: main -; OPT1-32: addi {{[0-9]+}}, {{[0-9]+}}, a@got@tlsld +; OPT1-32: addi 3, {{[0-9]+}}, a@got@tlsld ; OPT1-32: bl __tls_get_addr(a@tlsld)@PLT ; OPT1-32: addis [[REG:[0-9]+]], 3, a@dtprel@ha ; OPT1-32: addi {{[0-9]+}}, [[REG]], a@dtprel@l