[llvm] r185476 - [PowerPC] Remove VK_PPC_TLSGD and VK_PPC_TLSLD

Ulrich Weigand ulrich.weigand at de.ibm.com
Tue Jul 2 14:29:07 PDT 2013


Author: uweigand
Date: Tue Jul  2 16:29:06 2013
New Revision: 185476

URL: http://llvm.org/viewvc/llvm-project?rev=185476&view=rev
Log:

[PowerPC] Remove VK_PPC_TLSGD and VK_PPC_TLSLD

The PowerPC-specific modifiers VK_PPC_TLSGD and VK_PPC_TLSLD
correspond exactly to the generic modifiers VK_TLSGD and VK_TLSLD.
This causes some confusion with the asm parser, since VK_PPC_TLSGD
is output as @tlsgd, which is then read back in as VK_TLSGD.

To avoid this confusion, this patch removes the PowerPC-specific
modifiers and uses the generic modifiers throughout.  (The only
drawback is that the generic modifiers are printed in upper case
while the usual convention on PowerPC is to use lower-case modifiers.
But this is just a cosmetic issue.)


Modified:
    llvm/trunk/include/llvm/MC/MCExpr.h
    llvm/trunk/lib/MC/MCELFStreamer.cpp
    llvm/trunk/lib/MC/MCExpr.cpp
    llvm/trunk/lib/Target/PowerPC/MCTargetDesc/PPCELFObjectWriter.cpp
    llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp
    llvm/trunk/test/CodeGen/PowerPC/tls-gd.ll
    llvm/trunk/test/CodeGen/PowerPC/tls-ld-2.ll
    llvm/trunk/test/CodeGen/PowerPC/tls-ld.ll

Modified: llvm/trunk/include/llvm/MC/MCExpr.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCExpr.h?rev=185476&r1=185475&r2=185476&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCExpr.h (original)
+++ llvm/trunk/include/llvm/MC/MCExpr.h Tue Jul  2 16:29:06 2013
@@ -216,12 +216,10 @@ public:
     VK_PPC_GOT_TLSGD_LO,   // symbol at got@tlsgd at l
     VK_PPC_GOT_TLSGD_HI,   // symbol at got@tlsgd at h
     VK_PPC_GOT_TLSGD_HA,   // symbol at got@tlsgd at ha
-    VK_PPC_TLSGD,          // symbol at tlsgd
     VK_PPC_GOT_TLSLD,      // symbol at got@tlsld
     VK_PPC_GOT_TLSLD_LO,   // symbol at got@tlsld at l
     VK_PPC_GOT_TLSLD_HI,   // symbol at got@tlsld at h
     VK_PPC_GOT_TLSLD_HA,   // symbol at got@tlsld at ha
-    VK_PPC_TLSLD,          // symbol at tlsld
 
     VK_Mips_GPREL,
     VK_Mips_GOT_CALL,

Modified: llvm/trunk/lib/MC/MCELFStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCELFStreamer.cpp?rev=185476&r1=185475&r2=185476&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCELFStreamer.cpp (original)
+++ llvm/trunk/lib/MC/MCELFStreamer.cpp Tue Jul  2 16:29:06 2013
@@ -392,12 +392,10 @@ void  MCELFStreamer::fixSymbolsInTLSFixu
     case MCSymbolRefExpr::VK_PPC_GOT_TLSGD_LO:
     case MCSymbolRefExpr::VK_PPC_GOT_TLSGD_HI:
     case MCSymbolRefExpr::VK_PPC_GOT_TLSGD_HA:
-    case MCSymbolRefExpr::VK_PPC_TLSGD:
     case MCSymbolRefExpr::VK_PPC_GOT_TLSLD:
     case MCSymbolRefExpr::VK_PPC_GOT_TLSLD_LO:
     case MCSymbolRefExpr::VK_PPC_GOT_TLSLD_HI:
     case MCSymbolRefExpr::VK_PPC_GOT_TLSLD_HA:
-    case MCSymbolRefExpr::VK_PPC_TLSLD:
       break;
     }
     MCSymbolData &SD = getAssembler().getOrCreateSymbolData(symRef.getSymbol());

Modified: llvm/trunk/lib/MC/MCExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCExpr.cpp?rev=185476&r1=185475&r2=185476&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCExpr.cpp (original)
+++ llvm/trunk/lib/MC/MCExpr.cpp Tue Jul  2 16:29:06 2013
@@ -241,12 +241,10 @@ StringRef MCSymbolRefExpr::getVariantKin
   case VK_PPC_GOT_TLSGD_LO: return "got at tlsgd@l";
   case VK_PPC_GOT_TLSGD_HI: return "got at tlsgd@h";
   case VK_PPC_GOT_TLSGD_HA: return "got at tlsgd@ha";
-  case VK_PPC_TLSGD: return "tlsgd";
   case VK_PPC_GOT_TLSLD: return "got at tlsld";
   case VK_PPC_GOT_TLSLD_LO: return "got at tlsld@l";
   case VK_PPC_GOT_TLSLD_HI: return "got at tlsld@h";
   case VK_PPC_GOT_TLSLD_HA: return "got at tlsld@ha";
-  case VK_PPC_TLSLD: return "tlsld";
   case VK_Mips_GPREL: return "GPREL";
   case VK_Mips_GOT_CALL: return "GOT_CALL";
   case VK_Mips_GOT16: return "GOT16";

Modified: llvm/trunk/lib/Target/PowerPC/MCTargetDesc/PPCELFObjectWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/MCTargetDesc/PPCELFObjectWriter.cpp?rev=185476&r1=185475&r2=185476&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/MCTargetDesc/PPCELFObjectWriter.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/MCTargetDesc/PPCELFObjectWriter.cpp Tue Jul  2 16:29:06 2013
@@ -295,10 +295,10 @@ unsigned PPCELFObjectWriter::getRelocTyp
     case PPC::fixup_ppc_nofixup:
       switch (Modifier) {
       default: llvm_unreachable("Unsupported Modifier");
-      case MCSymbolRefExpr::VK_PPC_TLSGD:
+      case MCSymbolRefExpr::VK_TLSGD:
         Type = ELF::R_PPC64_TLSGD;
         break;
-      case MCSymbolRefExpr::VK_PPC_TLSLD:
+      case MCSymbolRefExpr::VK_TLSLD:
         Type = ELF::R_PPC64_TLSLD;
         break;
       }

Modified: llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp?rev=185476&r1=185475&r2=185476&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp Tue Jul  2 16:29:06 2013
@@ -573,8 +573,7 @@ void PPCAsmPrinter::EmitInstruction(cons
     const GlobalValue *GValue = MO.getGlobal();
     MCSymbol *MOSymbol = Mang->getSymbol(GValue);
     const MCExpr *SymVar =
-      MCSymbolRefExpr::Create(MOSymbol, MCSymbolRefExpr::VK_PPC_TLSGD,
-                              OutContext);
+      MCSymbolRefExpr::Create(MOSymbol, MCSymbolRefExpr::VK_TLSGD, OutContext);
     OutStreamer.EmitInstruction(MCInstBuilder(PPC::BL8_NOP_TLSGD)
                                 .addExpr(TlsRef)
                                 .addExpr(SymVar));
@@ -625,8 +624,7 @@ void PPCAsmPrinter::EmitInstruction(cons
     const GlobalValue *GValue = MO.getGlobal();
     MCSymbol *MOSymbol = Mang->getSymbol(GValue);
     const MCExpr *SymVar =
-      MCSymbolRefExpr::Create(MOSymbol, MCSymbolRefExpr::VK_PPC_TLSLD,
-                              OutContext);
+      MCSymbolRefExpr::Create(MOSymbol, MCSymbolRefExpr::VK_TLSLD, OutContext);
     OutStreamer.EmitInstruction(MCInstBuilder(PPC::BL8_NOP_TLSLD)
                                 .addExpr(TlsRef)
                                 .addExpr(SymVar));

Modified: llvm/trunk/test/CodeGen/PowerPC/tls-gd.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/tls-gd.ll?rev=185476&r1=185475&r2=185476&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/PowerPC/tls-gd.ll (original)
+++ llvm/trunk/test/CodeGen/PowerPC/tls-gd.ll Tue Jul  2 16:29:06 2013
@@ -18,6 +18,6 @@ entry:
 
 ; CHECK: addis [[REG:[0-9]+]], 2, a at got@tlsgd at ha
 ; CHECK-NEXT: addi 3, [[REG]], a at got@tlsgd at l
-; CHECK:      bl __tls_get_addr(a at tlsgd)
+; CHECK:      bl __tls_get_addr(a at TLSGD)
 ; CHECK-NEXT: nop
 

Modified: llvm/trunk/test/CodeGen/PowerPC/tls-ld-2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/tls-ld-2.ll?rev=185476&r1=185475&r2=185476&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/PowerPC/tls-ld-2.ll (original)
+++ llvm/trunk/test/CodeGen/PowerPC/tls-ld-2.ll Tue Jul  2 16:29:06 2013
@@ -18,7 +18,7 @@ entry:
 
 ; CHECK:      addis [[REG:[0-9]+]], 2, a at got@tlsld at ha
 ; CHECK-NEXT: addi 3, [[REG]], a at got@tlsld at l
-; CHECK:      bl __tls_get_addr(a at tlsld)
+; CHECK:      bl __tls_get_addr(a at TLSLD)
 ; CHECK-NEXT: nop
 ; CHECK:      addis [[REG2:[0-9]+]], 3, a at dtprel@ha
 ; CHECK-NEXT: lwa {{[0-9]+}}, a at dtprel@l([[REG2]])

Modified: llvm/trunk/test/CodeGen/PowerPC/tls-ld.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/tls-ld.ll?rev=185476&r1=185475&r2=185476&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/PowerPC/tls-ld.ll (original)
+++ llvm/trunk/test/CodeGen/PowerPC/tls-ld.ll Tue Jul  2 16:29:06 2013
@@ -18,7 +18,7 @@ entry:
 
 ; CHECK:      addis [[REG:[0-9]+]], 2, a at got@tlsld at ha
 ; CHECK-NEXT: addi 3, [[REG]], a at got@tlsld at l
-; CHECK:      bl __tls_get_addr(a at tlsld)
+; CHECK:      bl __tls_get_addr(a at TLSLD)
 ; CHECK-NEXT: nop
 ; CHECK:      addis [[REG2:[0-9]+]], 3, a at dtprel@ha
 ; CHECK-NEXT: addi {{[0-9]+}}, [[REG2]], a at dtprel@l





More information about the llvm-commits mailing list