[PATCH] D132348: [AIX] remove the error report for the symbol name startswith "_Renamed.."

Esme Yi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 21 22:28:00 PDT 2022


Esme created this revision.
Esme added reviewers: shchenz, DiggerLin, PowerPC, qiucf, lkail.
Herald added subscribers: hiraditya, nemanjai.
Herald added a project: All.
Esme requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

An error was reported when a thread local symbol has an invalid name.
It should not be an error when we call the `getOrCreateSymbol()` for a symbol which has been renamed.
D100956 <https://reviews.llvm.org/D100956> create a new symbol to prefix the TLS symbol name with a dot. When the symbol name is renamed, the error occurs.
This patch remove the error report. Removing the error report has no impact for the functionality.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D132348

Files:
  llvm/lib/MC/MCContext.cpp
  llvm/test/CodeGen/PowerPC/aix-xcoff-tls-rename.ll


Index: llvm/test/CodeGen/PowerPC/aix-xcoff-tls-rename.ll
===================================================================
--- /dev/null
+++ llvm/test/CodeGen/PowerPC/aix-xcoff-tls-rename.ll
@@ -0,0 +1,15 @@
+; RUN: llc -verify-machineinstrs -mtriple powerpc64-ibm-aix-xcoff -mcpu=pwr4 \
+; RUN:     -mattr=-altivec -data-sections=false -xcoff-traceback-table=false < %s | FileCheck %s
+
+; CHECK:      .extern .__tls_get_addr[PR]
+; CHECK-NEXT: .csect .tdata[TL],2
+; CHECK-NEXT: .globl  _Renamed..24f_f                 # @"f$f"
+; CHECK-NEXT: .rename _Renamed..24f_f,"f$f"
+
+@"f$f" = thread_local global i32 10, align 4
+
+define void @fun() {
+entry:
+  store i32 1, ptr @"f$f", align 4
+  ret void
+}
Index: llvm/lib/MC/MCContext.cpp
===================================================================
--- llvm/lib/MC/MCContext.cpp
+++ llvm/lib/MC/MCContext.cpp
@@ -386,9 +386,6 @@
     return new (nullptr, *this) MCSymbolXCOFF(nullptr, IsTemporary);
 
   StringRef OriginalName = Name->first();
-  if (OriginalName.startswith("._Renamed..") ||
-      OriginalName.startswith("_Renamed.."))
-    reportError(SMLoc(), "invalid symbol name from source");
 
   if (MAI->isValidUnquotedName(OriginalName))
     return new (Name, *this) MCSymbolXCOFF(Name, IsTemporary);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D132348.454384.patch
Type: text/x-patch
Size: 1274 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220822/1b8e8789/attachment.bin>


More information about the llvm-commits mailing list