[llvm] r232483 - Use createTempSymbol to avoid collisions instead of an ad hoc method.
Rafael Espindola
rafael.espindola at gmail.com
Tue Mar 17 07:50:32 PDT 2015
Author: rafael
Date: Tue Mar 17 09:50:32 2015
New Revision: 232483
URL: http://llvm.org/viewvc/llvm-project?rev=232483&view=rev
Log:
Use createTempSymbol to avoid collisions instead of an ad hoc method.
Modified:
llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp
llvm/trunk/test/CodeGen/PowerPC/2012-09-16-TOC-entry-check.ll
llvm/trunk/test/CodeGen/PowerPC/alias.ll
Modified: llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp?rev=232483&r1=232482&r2=232483&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp Tue Mar 17 09:50:32 2015
@@ -321,17 +321,9 @@ bool PPCAsmPrinter::PrintAsmMemoryOperan
/// exists for it. If not, create one. Then return a symbol that references
/// the TOC entry.
MCSymbol *PPCAsmPrinter::lookUpOrCreateTOCEntry(MCSymbol *Sym) {
- const DataLayout *DL = TM.getDataLayout();
MCSymbol *&TOCEntry = TOC[Sym];
-
- // To avoid name clash check if the name already exists.
- while (!TOCEntry) {
- if (OutContext.LookupSymbol(Twine(DL->getPrivateGlobalPrefix()) +
- "C" + Twine(TOCLabelID++)) == nullptr) {
- TOCEntry = GetTempSymbol("C", TOCLabelID);
- }
- }
-
+ if (!TOCEntry)
+ TOCEntry = createTempSymbol("C", TOCLabelID++);
return TOCEntry;
}
Modified: llvm/trunk/test/CodeGen/PowerPC/2012-09-16-TOC-entry-check.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/2012-09-16-TOC-entry-check.ll?rev=232483&r1=232482&r2=232483&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/PowerPC/2012-09-16-TOC-entry-check.ll (original)
+++ llvm/trunk/test/CodeGen/PowerPC/2012-09-16-TOC-entry-check.ll Tue Mar 17 09:50:32 2015
@@ -19,9 +19,9 @@ define i32 @foo(double %X, double %Y) no
}
; Check the creation of 2 .tc entries for both double constants. They
-; should be .LC1 and .LC3 to avoid name clash with global constants
-; .LC0 and .LC2
-; CHECK: .LC{{[13]}}:
+; avoid name clash with global constants .LC0 and .LC2
+; CHECK: .section .toc,"aw", at progbits
+; CHECK: .LC{{.*}}:
; CHECK-NEXT: .tc {{[\._a-zA-Z0-9]+}}[TC],{{[\._a-zA-Z0-9]+}}
-; CHECK: .LC{{[13]}}:
+; CHECK: .LC{{.*}}:
; CHECK-NEXT: .tc {{[\._a-zA-Z0-9]+}}[TC],{{[\._a-zA-Z0-9]+}}
Modified: llvm/trunk/test/CodeGen/PowerPC/alias.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/alias.ll?rev=232483&r1=232482&r2=232483&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/PowerPC/alias.ll (original)
+++ llvm/trunk/test/CodeGen/PowerPC/alias.ll Tue Mar 17 09:50:32 2015
@@ -10,7 +10,7 @@
; CHECK-LABEL: bar:
define i32 @bar() {
; MEDIUM: addis 3, 2, fooa at toc@ha
-; LARGE: addis 3, 2, .LC1 at toc@ha
+; LARGE: addis 3, 2, .L[[L0:.*]]@toc at ha
%a = load i32, i32* @fooa
ret i32 %a
}
@@ -19,13 +19,13 @@ define i32 @bar() {
define i64 @bar2() {
; MEDIUM: addis 3, 2, foo2a at toc@ha
; MEDIUM: addi 3, 3, foo2a at toc@l
-; LARGE: addis 3, 2, .LC3 at toc@ha
+; LARGE: addis 3, 2, .L[[L1:.*]]@toc at ha
%a = load i64, i64* @foo2a
ret i64 %a
}
-; LARGE: .LC1:
+; LARGE: .L[[L0]]:
; LARGE-NEXT: .tc fooa[TC],fooa
-; LARGE: .LC3:
+; LARGE: .L[[L1]]:
; LARGE-NEXT: .tc foo2a[TC],foo2a
More information about the llvm-commits
mailing list