[PATCH] D66925: [PPC32] Emit R_PPC_GOT_TPREL16 instead R_PPC_GOT_TPREL16_LO
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 29 19:20:32 PDT 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rL370426: [PPC32] Emit R_PPC_GOT_TPREL16 instead R_PPC_GOT_TPREL16_LO (authored by MaskRay, committed by ).
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D66925/new/
https://reviews.llvm.org/D66925
Files:
llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp
llvm/trunk/test/CodeGen/PowerPC/tls.ll
Index: llvm/trunk/test/CodeGen/PowerPC/tls.ll
===================================================================
--- llvm/trunk/test/CodeGen/PowerPC/tls.ll
+++ llvm/trunk/test/CodeGen/PowerPC/tls.ll
@@ -43,7 +43,7 @@
;OPT0-PPC32-LABEL: main2:
;OPT0-PPC32: li [[REG1:[0-9]+]], _GLOBAL_OFFSET_TABLE_ at l
;OPT0-PPC32: addis [[REG1]], [[REG1]], _GLOBAL_OFFSET_TABLE_ at ha
-;OPT0-PPC32: lwz [[REG2:[0-9]+]], a2 at got@tprel at l([[REG1]])
+;OPT0-PPC32: lwz [[REG2:[0-9]+]], a2 at got@tprel([[REG1]])
;OPT0-PPC32: add 3, [[REG2]], a2 at tls
;OPT0-PPC32-PIC-LABEL: main2:
@@ -51,4 +51,4 @@
;OPT0-PPC32-PIC-NOT: li {{[0-9]+}}, _GLOBAL_OFFSET_TABLE_ at l
;OPT0-PPC32-PIC-NOT: addis {{[0-9]+}}, {{[0-9+]}}, _GLOBAL_OFFSET_TABLE_ at ha
;OPT0-PPC32-PIC-NOT: bl __tls_get_addr(a2 at tlsgd)@PLT
-;OPT0-PPC32-PIC: lwz {{[0-9]+}}, a2 at got@tprel at l({{[0-9]+}})
+;OPT0-PPC32-PIC: lwz {{[0-9]+}}, a2 at got@tprel({{[0-9]+}})
Index: llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp
===================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp
+++ llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp
@@ -870,8 +870,10 @@
const GlobalValue *GValue = MO.getGlobal();
MCSymbol *MOSymbol = getSymbol(GValue);
const MCExpr *Exp =
- MCSymbolRefExpr::create(MOSymbol, MCSymbolRefExpr::VK_PPC_GOT_TPREL_LO,
- OutContext);
+ MCSymbolRefExpr::create(MOSymbol,
+ isPPC64 ? MCSymbolRefExpr::VK_PPC_GOT_TPREL_LO
+ : MCSymbolRefExpr::VK_PPC_GOT_TPREL,
+ OutContext);
TmpInst.getOperand(1) = MCOperand::createExpr(Exp);
EmitToStreamer(*OutStreamer, TmpInst);
return;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D66925.218011.patch
Type: text/x-patch
Size: 1795 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190830/5aeab361/attachment.bin>
More information about the llvm-commits
mailing list