From 1354f7c5fa3e08a87a4d1d6b3c401e88f928f48e 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 llvm-svn: 228116 --- llvm/lib/Target/PowerPC/PPCTLSDynamicCall.cpp | 4 +++- llvm/test/CodeGen/PowerPC/tls-pic.ll | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/llvm/lib/Target/PowerPC/PPCTLSDynamicCall.cpp b/llvm/lib/Target/PowerPC/PPCTLSDynamicCall.cpp index b0e1dfa..1b74c4e 100644 --- a/llvm/lib/Target/PowerPC/PPCTLSDynamicCall.cpp +++ b/llvm/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/llvm/test/CodeGen/PowerPC/tls-pic.ll b/llvm/test/CodeGen/PowerPC/tls-pic.ll index b678214..549cd19 100644 --- a/llvm/test/CodeGen/PowerPC/tls-pic.ll +++ b/llvm/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 -- 2.7.4