Browse Source

Have a single way for creating unique value names.

We had two code paths. One would create names like "foo.1" and the other
names like "foo1".

For globals it is important to use "foo.1" to help C++ name demangling.
For locals there is no strong reason to go one way or the other so I
kept the most common mangling (foo1).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253804 91177308-0d34-0410-b5e6-96231b3b80d8
Rafael Espindola 9 years ago
parent
commit
a2197f8f51

+ 3 - 0
include/llvm/IR/ValueSymbolTable.h

@@ -14,6 +14,7 @@
 #ifndef LLVM_IR_VALUESYMBOLTABLE_H
 #ifndef LLVM_IR_VALUESYMBOLTABLE_H
 #define LLVM_IR_VALUESYMBOLTABLE_H
 #define LLVM_IR_VALUESYMBOLTABLE_H
 
 
+#include "llvm/ADT/SmallString.h"
 #include "llvm/ADT/StringMap.h"
 #include "llvm/ADT/StringMap.h"
 #include "llvm/IR/Value.h"
 #include "llvm/IR/Value.h"
 #include "llvm/Support/DataTypes.h"
 #include "llvm/Support/DataTypes.h"
@@ -99,6 +100,8 @@ public:
   /// @name Mutators
   /// @name Mutators
   /// @{
   /// @{
 private:
 private:
+  ValueName *makeUniqueName(Value *V, SmallString<256> &UniqueName);
+
   /// This method adds the provided value \p N to the symbol table.  The Value
   /// This method adds the provided value \p N to the symbol table.  The Value
   /// must have a name which is used to place the value in the symbol table.
   /// must have a name which is used to place the value in the symbol table.
   /// If the inserted name conflicts, this renames the value.
   /// If the inserted name conflicts, this renames the value.

+ 21 - 29
lib/IR/ValueSymbolTable.cpp

@@ -32,6 +32,24 @@ ValueSymbolTable::~ValueSymbolTable() {
 #endif
 #endif
 }
 }
 
 
+ValueName *ValueSymbolTable::makeUniqueName(Value *V,
+                                            SmallString<256> &UniqueName) {
+  unsigned BaseSize = UniqueName.size();
+  while (1) {
+    // Trim any suffix off and append the next number.
+    UniqueName.resize(BaseSize);
+    raw_svector_ostream S(UniqueName);
+    if (isa<GlobalValue>(V))
+      S << ".";
+    S << ++LastUnique;
+
+    // Try insert the vmap entry with this suffix.
+    auto IterBool = vmap.insert(std::make_pair(UniqueName, V));
+    if (IterBool.second)
+      return &*IterBool.first;
+  }
+}
+
 // Insert a value into the symbol table with the specified name...
 // Insert a value into the symbol table with the specified name...
 //
 //
 void ValueSymbolTable::reinsertValue(Value* V) {
 void ValueSymbolTable::reinsertValue(Value* V) {
@@ -49,21 +67,8 @@ void ValueSymbolTable::reinsertValue(Value* V) {
   // The name is too already used, just free it so we can allocate a new name.
   // The name is too already used, just free it so we can allocate a new name.
   V->getValueName()->Destroy();
   V->getValueName()->Destroy();
 
 
-  unsigned BaseSize = UniqueName.size();
-  while (1) {
-    // Trim any suffix off and append the next number.
-    UniqueName.resize(BaseSize);
-    raw_svector_ostream(UniqueName) << "." << ++LastUnique;
-
-    // Try insert the vmap entry with this suffix.
-    auto IterBool = vmap.insert(std::make_pair(UniqueName, V));
-    if (IterBool.second) {
-      // Newly inserted name.  Success!
-      V->setValueName(&*IterBool.first);
-     //DEBUG(dbgs() << " Inserted value: " << UniqueName << ": " << *V << "\n");
-      return;
-    }
-  }
+  ValueName *VN = makeUniqueName(V, UniqueName);
+  V->setValueName(VN);
 }
 }
 
 
 void ValueSymbolTable::removeValueName(ValueName *V) {
 void ValueSymbolTable::removeValueName(ValueName *V) {
@@ -86,20 +91,7 @@ ValueName *ValueSymbolTable::createValueName(StringRef Name, Value *V) {
   
   
   // Otherwise, there is a naming conflict.  Rename this value.
   // Otherwise, there is a naming conflict.  Rename this value.
   SmallString<256> UniqueName(Name.begin(), Name.end());
   SmallString<256> UniqueName(Name.begin(), Name.end());
-  
-  while (1) {
-    // Trim any suffix off and append the next number.
-    UniqueName.resize(Name.size());
-    raw_svector_ostream(UniqueName) << ++LastUnique;
-    
-    // Try insert the vmap entry with this suffix.
-    auto IterBool = vmap.insert(std::make_pair(UniqueName, V));
-    if (IterBool.second) {
-      // DEBUG(dbgs() << " Inserted value: " << UniqueName << ": " << *V <<
-      //       "\n");
-      return &*IterBool.first;
-    }
-  }
+  return makeUniqueName(V, UniqueName);
 }
 }
 
 
 
 

+ 2 - 2
test/CodeGen/NVPTX/symbol-naming.ll

@@ -7,10 +7,10 @@
 ; PTX32-NOT: .str
 ; PTX32-NOT: .str
 ; PTX64-NOT: .str
 ; PTX64-NOT: .str
 
 
-; PTX32-DAG: _$_str1
+; PTX32-DAG: _$_str.1
 ; PTX32-DAG: _$_str
 ; PTX32-DAG: _$_str
 
 
-; PTX64-DAG: _$_str1
+; PTX64-DAG: _$_str.1
 ; PTX64-DAG: _$_str
 ; PTX64-DAG: _$_str
 
 
 target datalayout = "e-i64:64-v16:16-v32:32-n16:32:64"
 target datalayout = "e-i64:64-v16:16-v32:32-n16:32:64"

+ 2 - 2
test/Linker/2003-01-30-LinkerRename.ll

@@ -2,9 +2,9 @@
 ; RUN: llvm-as %s -o %t.2.bc
 ; RUN: llvm-as %s -o %t.2.bc
 ; RUN: llvm-link %t.1.bc %t.2.bc -S | FileCheck %s
 ; RUN: llvm-link %t.1.bc %t.2.bc -S | FileCheck %s
 
 
-; CHECK: @bar = global i32 ()* @foo2
+; CHECK: @bar = global i32 ()* @foo.2
 
 
-; CHECK:      define internal i32 @foo2() {
+; CHECK:      define internal i32 @foo.2() {
 ; CHECK-NEXT:   ret i32 7
 ; CHECK-NEXT:   ret i32 7
 ; CHECK-NEXT: }
 ; CHECK-NEXT: }
 
 

+ 2 - 2
test/Linker/2003-05-31-LinkerRename.ll

@@ -2,9 +2,9 @@
 ; RUN: llvm-as  %s -o %t.2.bc
 ; RUN: llvm-as  %s -o %t.2.bc
 ; RUN: llvm-link %t.1.bc %t.2.bc -S | FileCheck %s
 ; RUN: llvm-link %t.1.bc %t.2.bc -S | FileCheck %s
 
 
-; CHECK: @bar = global i32 ()* @foo2
+; CHECK: @bar = global i32 ()* @foo.2
 
 
-; CHECK:      define internal i32 @foo2() {
+; CHECK:      define internal i32 @foo.2() {
 ; CHECK-NEXT:   ret i32 7
 ; CHECK-NEXT:   ret i32 7
 ; CHECK-NEXT: }
 ; CHECK-NEXT: }
 
 

+ 2 - 2
test/Linker/override-with-internal-linkage.ll

@@ -3,14 +3,14 @@
 
 
 ; CHECK-LABEL: define i32 @main(
 ; CHECK-LABEL: define i32 @main(
 ; CHECK-NEXT: entry:
 ; CHECK-NEXT: entry:
-; CHECK-NEXT: call i32 @foo2(
+; CHECK-NEXT: call i32 @foo.2(
 define i32 @main(i32 %argc, i8** %argv) {
 define i32 @main(i32 %argc, i8** %argv) {
 entry:
 entry:
   %a = call i32 @foo(i32 2)
   %a = call i32 @foo(i32 2)
   ret i32 %a
   ret i32 %a
 }
 }
 
 
-; CHECK-LABEL: define internal i32 @foo2(
+; CHECK-LABEL: define internal i32 @foo.2(
 ; CHECK-NEXT: entry:
 ; CHECK-NEXT: entry:
 ; CHECK-NEXT: %add = add nsw i32 %i, %i
 ; CHECK-NEXT: %add = add nsw i32 %i, %i
 ; CHECK-NEXT: ret i32 %add
 ; CHECK-NEXT: ret i32 %add

+ 1 - 1
test/Linker/testlink.ll

@@ -43,7 +43,7 @@
 
 
 ; This should get renamed since there is a definition that is non-internal in
 ; This should get renamed since there is a definition that is non-internal in
 ; the other module.
 ; the other module.
-; CHECK-DAG: @Intern2{{[0-9]+}} = internal constant i32 792
+; CHECK-DAG: @Intern2.{{[0-9]+}} = internal constant i32 792
 @Intern2 = internal constant i32 792
 @Intern2 = internal constant i32 792
 
 
 @UseIntern2 = global i32* @Intern2
 @UseIntern2 = global i32* @Intern2

+ 8 - 8
test/Transforms/BBVectorize/simple3.ll

@@ -4,12 +4,12 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3
 ; Basic depth-3 chain
 ; Basic depth-3 chain
 define double @test1(double %A1, double %A2, double %A3, double %B1, double %B2, double %B3) {
 define double @test1(double %A1, double %A2, double %A3, double %B1, double %B2, double %B3) {
 ; CHECK-LABEL: @test1(
 ; CHECK-LABEL: @test1(
-; CHECK: %X1.v.i1.1.1 = insertelement <3 x double> undef, double %B1, i32 0
-; CHECK: %X1.v.i1.2.2 = insertelement <3 x double> %X1.v.i1.1.1, double %B2, i32 1
-; CHECK: %X1.v.i1 = insertelement <3 x double> %X1.v.i1.2.2, double %B3, i32 2
-; CHECK: %X1.v.i0.1.3 = insertelement <3 x double> undef, double %A1, i32 0
-; CHECK: %X1.v.i0.2.4 = insertelement <3 x double> %X1.v.i0.1.3, double %A2, i32 1
-; CHECK: %X1.v.i0 = insertelement <3 x double> %X1.v.i0.2.4, double %A3, i32 2
+; CHECK: %X1.v.i1.11 = insertelement <3 x double> undef, double %B1, i32 0
+; CHECK: %X1.v.i1.22 = insertelement <3 x double> %X1.v.i1.11, double %B2, i32 1
+; CHECK: %X1.v.i1 = insertelement <3 x double> %X1.v.i1.22, double %B3, i32 2
+; CHECK: %X1.v.i0.13 = insertelement <3 x double> undef, double %A1, i32 0
+; CHECK: %X1.v.i0.24 = insertelement <3 x double> %X1.v.i0.13, double %A2, i32 1
+; CHECK: %X1.v.i0 = insertelement <3 x double> %X1.v.i0.24, double %A3, i32 2
 	%X1 = fsub double %A1, %B1
 	%X1 = fsub double %A1, %B1
 	%X2 = fsub double %A2, %B2
 	%X2 = fsub double %A2, %B2
 	%X3 = fsub double %A3, %B3
 	%X3 = fsub double %A3, %B3
@@ -24,11 +24,11 @@ define double @test1(double %A1, double %A2, double %A3, double %B1, double %B2,
 ; CHECK: %Z1 = fadd <3 x double> %Y1, %X1.v.i1
 ; CHECK: %Z1 = fadd <3 x double> %Y1, %X1.v.i1
         %R1 = fmul double %Z1, %Z2
         %R1 = fmul double %Z1, %Z2
 	%R  = fmul double %R1, %Z3
 	%R  = fmul double %R1, %Z3
-; CHECK: %Z1.v.r2.10 = extractelement <3 x double> %Z1, i32 2
+; CHECK: %Z1.v.r210 = extractelement <3 x double> %Z1, i32 2
 ; CHECK: %Z1.v.r1 = extractelement <3 x double> %Z1, i32 0
 ; CHECK: %Z1.v.r1 = extractelement <3 x double> %Z1, i32 0
 ; CHECK: %Z1.v.r2 = extractelement <3 x double> %Z1, i32 1
 ; CHECK: %Z1.v.r2 = extractelement <3 x double> %Z1, i32 1
 ; CHECK: %R1 = fmul double %Z1.v.r1, %Z1.v.r2
 ; CHECK: %R1 = fmul double %Z1.v.r1, %Z1.v.r2
-; CHECK: %R = fmul double %R1, %Z1.v.r2.10
+; CHECK: %R = fmul double %R1, %Z1.v.r210
 	ret double %R
 	ret double %R
 ; CHECK: ret double %R
 ; CHECK: ret double %R
 }
 }

+ 6 - 6
test/Transforms/Inline/noalias-cs.ll

@@ -34,13 +34,13 @@ entry:
 ; CHECK:   %arrayidx.i = getelementptr inbounds float, float* %a, i64 7
 ; CHECK:   %arrayidx.i = getelementptr inbounds float, float* %a, i64 7
 ; CHECK:   store float %1, float* %arrayidx.i, align 4, !noalias !16
 ; CHECK:   store float %1, float* %arrayidx.i, align 4, !noalias !16
 ; CHECK:   %2 = load float, float* %a, align 4, !alias.scope !16, !noalias !17
 ; CHECK:   %2 = load float, float* %a, align 4, !alias.scope !16, !noalias !17
-; CHECK:   %arrayidx.i.i.1 = getelementptr inbounds float, float* %b, i64 5
-; CHECK:   store float %2, float* %arrayidx.i.i.1, align 4, !alias.scope !21, !noalias !22
-; CHECK:   %arrayidx1.i.i.2 = getelementptr inbounds float, float* %b, i64 8
-; CHECK:   store float %2, float* %arrayidx1.i.i.2, align 4, !alias.scope !23, !noalias !24
+; CHECK:   %arrayidx.i.i1 = getelementptr inbounds float, float* %b, i64 5
+; CHECK:   store float %2, float* %arrayidx.i.i1, align 4, !alias.scope !21, !noalias !22
+; CHECK:   %arrayidx1.i.i2 = getelementptr inbounds float, float* %b, i64 8
+; CHECK:   store float %2, float* %arrayidx1.i.i2, align 4, !alias.scope !23, !noalias !24
 ; CHECK:   %3 = load float, float* %a, align 4, !alias.scope !16
 ; CHECK:   %3 = load float, float* %a, align 4, !alias.scope !16
-; CHECK:   %arrayidx.i.3 = getelementptr inbounds float, float* %b, i64 7
-; CHECK:   store float %3, float* %arrayidx.i.3, align 4, !alias.scope !16
+; CHECK:   %arrayidx.i3 = getelementptr inbounds float, float* %b, i64 7
+; CHECK:   store float %3, float* %arrayidx.i3, align 4, !alias.scope !16
 ; CHECK:   ret void
 ; CHECK:   ret void
 ; CHECK: }
 ; CHECK: }
 
 

+ 2 - 2
test/Transforms/Inline/noalias2.ll

@@ -61,8 +61,8 @@ entry:
 ; CHECK:   %arrayidx.i = getelementptr inbounds float, float* %a, i64 7
 ; CHECK:   %arrayidx.i = getelementptr inbounds float, float* %a, i64 7
 ; CHECK:   store float %1, float* %arrayidx.i, align 4, !alias.scope !14, !noalias !13
 ; CHECK:   store float %1, float* %arrayidx.i, align 4, !alias.scope !14, !noalias !13
 ; CHECK:   %2 = load float, float* %c, align 4, !noalias !15
 ; CHECK:   %2 = load float, float* %c, align 4, !noalias !15
-; CHECK:   %arrayidx.i.1 = getelementptr inbounds float, float* %a, i64 6
-; CHECK:   store float %2, float* %arrayidx.i.1, align 4, !alias.scope !19, !noalias !20
+; CHECK:   %arrayidx.i1 = getelementptr inbounds float, float* %a, i64 6
+; CHECK:   store float %2, float* %arrayidx.i1, align 4, !alias.scope !19, !noalias !20
 ; CHECK:   %arrayidx1.i = getelementptr inbounds float, float* %b, i64 8
 ; CHECK:   %arrayidx1.i = getelementptr inbounds float, float* %b, i64 8
 ; CHECK:   store float %2, float* %arrayidx1.i, align 4, !alias.scope !20, !noalias !19
 ; CHECK:   store float %2, float* %arrayidx1.i, align 4, !alias.scope !20, !noalias !19
 ; CHECK:   %3 = load float, float* %c, align 4
 ; CHECK:   %3 = load float, float* %c, align 4

+ 2 - 2
test/Transforms/InstCombine/cast.ll

@@ -187,8 +187,8 @@ define i32 @test21(i32 %X) {
         %c2 = sext i8 %c1 to i32                ; <i32> [#uses=1]
         %c2 = sext i8 %c1 to i32                ; <i32> [#uses=1]
         %RV = and i32 %c2, 255          ; <i32> [#uses=1]
         %RV = and i32 %c2, 255          ; <i32> [#uses=1]
         ret i32 %RV
         ret i32 %RV
-; CHECK: %c2.1 = and i32 %X, 255
-; CHECK: ret i32 %c2.1
+; CHECK: %c21 = and i32 %X, 255
+; CHECK: ret i32 %c21
 }
 }
 
 
 define i32 @test22(i32 %X) {
 define i32 @test22(i32 %X) {

+ 2 - 2
test/Transforms/InstCombine/shift.ll

@@ -575,7 +575,7 @@ entry:
 ; CHECK: %0 = shl i8 %tmp4, 2
 ; CHECK: %0 = shl i8 %tmp4, 2
 ; CHECK: %tmp54 = and i8 %0, 16
 ; CHECK: %tmp54 = and i8 %0, 16
   %tmp55 = xor i8 %tmp54, %tmp51
   %tmp55 = xor i8 %tmp54, %tmp51
-; CHECK: ret i8 %tmp55.1
+; CHECK: ret i8 %tmp551
   ret i8 %tmp55
   ret i8 %tmp55
 }
 }
 
 
@@ -743,7 +743,7 @@ define i32 @test57(i32 %x) {
   %or = or i32 %shl, 7
   %or = or i32 %shl, 7
   ret i32 %or
   ret i32 %or
 ; CHECK-LABEL: @test57(
 ; CHECK-LABEL: @test57(
-; CHECK: %shl = shl i32 %shr.1, 4
+; CHECK: %shl = shl i32 %shr1, 4
 }
 }
 
 
 
 

+ 4 - 4
test/Transforms/InstCombine/xor.ll

@@ -63,8 +63,8 @@ define i32 @test7(i32 %A, i32 %B) {
 ; CHECK-LABEL: @test7(
 ; CHECK-LABEL: @test7(
 ; CHECK-NEXT: %A1 = and i32 %A, 7
 ; CHECK-NEXT: %A1 = and i32 %A, 7
 ; CHECK-NEXT: %B1 = and i32 %B, 128
 ; CHECK-NEXT: %B1 = and i32 %B, 128
-; CHECK-NEXT: %C1.1 = or i32 %A1, %B1
-; CHECK-NEXT: ret i32 %C1.1
+; CHECK-NEXT: %C11 = or i32 %A1, %B1
+; CHECK-NEXT: ret i32 %C11
 	%A1 = and i32 %A, 7		; <i32> [#uses=1]
 	%A1 = and i32 %A, 7		; <i32> [#uses=1]
 	%B1 = and i32 %B, 128		; <i32> [#uses=1]
 	%B1 = and i32 %B, 128		; <i32> [#uses=1]
 	%C1 = xor i32 %A1, %B1		; <i32> [#uses=1]
 	%C1 = xor i32 %A1, %B1		; <i32> [#uses=1]
@@ -96,8 +96,8 @@ define i1 @test9(i8 %A) {
 define i8 @test10(i8 %A) {
 define i8 @test10(i8 %A) {
 ; CHECK-LABEL: @test10(
 ; CHECK-LABEL: @test10(
 ; CHECK-NEXT: %B = and i8 %A, 3
 ; CHECK-NEXT: %B = and i8 %A, 3
-; CHECK-NEXT: %C.1 = or i8 %B, 4
-; CHECK-NEXT: ret i8 %C.1
+; CHECK-NEXT: %C1 = or i8 %B, 4
+; CHECK-NEXT: ret i8 %C1
 	%B = and i8 %A, 3		; <i8> [#uses=1]
 	%B = and i8 %A, 3		; <i8> [#uses=1]
 	%C = xor i8 %B, 4		; <i8> [#uses=1]
 	%C = xor i8 %B, 4		; <i8> [#uses=1]
 	ret i8 %C
 	ret i8 %C

+ 1 - 1
test/Transforms/LoopUnswitch/2011-11-18-SimpleSwitch.ll

@@ -34,7 +34,7 @@
 ; CHECK-NEXT:   br label %loop_begin.us1
 ; CHECK-NEXT:   br label %loop_begin.us1
 
 
 ; CHECK:      loop_begin.us1:                                   ; preds = %loop_begin.backedge.us5, %.split.split.us
 ; CHECK:      loop_begin.us1:                                   ; preds = %loop_begin.backedge.us5, %.split.split.us
-; CHECK-NEXT:   %var_val.us.2 = load i32, i32* %var
+; CHECK-NEXT:   %var_val.us2 = load i32, i32* %var
 ; CHECK-NEXT:   switch i32 2, label %default.us-lcssa.us-lcssa.us [
 ; CHECK-NEXT:   switch i32 2, label %default.us-lcssa.us-lcssa.us [
 ; CHECK-NEXT:     i32 1, label %inc.us4
 ; CHECK-NEXT:     i32 1, label %inc.us4
 ; CHECK-NEXT:     i32 2, label %dec.us3
 ; CHECK-NEXT:     i32 2, label %dec.us3

+ 1 - 1
test/Transforms/LoopUnswitch/2011-11-18-TwoSwitches.ll

@@ -65,7 +65,7 @@
 ; CHECK-NEXT:   br label %loop_begin.us1
 ; CHECK-NEXT:   br label %loop_begin.us1
 
 
 ; CHECK:      loop_begin.us1:                                   ; preds = %loop_begin.backedge.us6, %.split.split.us
 ; CHECK:      loop_begin.us1:                                   ; preds = %loop_begin.backedge.us6, %.split.split.us
-; CHECK-NEXT:   %var_val.us.2 = load i32, i32* %var
+; CHECK-NEXT:   %var_val.us2 = load i32, i32* %var
 ; CHECK-NEXT:   switch i32 %c, label %second_switch.us3 [
 ; CHECK-NEXT:   switch i32 %c, label %second_switch.us3 [
 ; CHECK-NEXT:     i32 1, label %loop_begin.inc_crit_edge.us
 ; CHECK-NEXT:     i32 1, label %loop_begin.inc_crit_edge.us
 ; CHECK-NEXT:   ]
 ; CHECK-NEXT:   ]

+ 30 - 30
test/Transforms/LowerSwitch/feature.ll

@@ -4,49 +4,49 @@
 ; On output we should got binary comparison tree. Check that all is fine.
 ; On output we should got binary comparison tree. Check that all is fine.
 
 
 ;CHECK:     entry:
 ;CHECK:     entry:
-;CHECK-NEXT:  br label %NodeBlock.19
+;CHECK-NEXT:  br label %NodeBlock19
 
 
-;CHECK:     NodeBlock.19:                                      ; preds = %entry
-;CHECK-NEXT:  %Pivot.20 = icmp slt i32 %tmp158, 10
-;CHECK-NEXT:  br i1 %Pivot.20, label %NodeBlock.5, label %NodeBlock.17
+;CHECK:     NodeBlock19:                                      ; preds = %entry
+;CHECK-NEXT:  %Pivot20 = icmp slt i32 %tmp158, 10
+;CHECK-NEXT:  br i1 %Pivot20, label %NodeBlock5, label %NodeBlock17
 
 
-;CHECK:     NodeBlock.17:                                      ; preds = %NodeBlock.19
-;CHECK-NEXT:  %Pivot.18 = icmp slt i32 %tmp158, 13
-;CHECK-NEXT:  br i1 %Pivot.18, label %NodeBlock.9, label %NodeBlock.15
+;CHECK:     NodeBlock17:                                      ; preds = %NodeBlock19
+;CHECK-NEXT:  %Pivot18 = icmp slt i32 %tmp158, 13
+;CHECK-NEXT:  br i1 %Pivot18, label %NodeBlock9, label %NodeBlock15
 
 
-;CHECK:     NodeBlock.15:                                      ; preds = %NodeBlock.17
-;CHECK-NEXT:  %Pivot.16 = icmp slt i32 %tmp158, 14
-;CHECK-NEXT:  br i1 %Pivot.16, label %bb330, label %NodeBlock.13
+;CHECK:     NodeBlock15:                                      ; preds = %NodeBlock17
+;CHECK-NEXT:  %Pivot16 = icmp slt i32 %tmp158, 14
+;CHECK-NEXT:  br i1 %Pivot16, label %bb330, label %NodeBlock13
 
 
-;CHECK:     NodeBlock.13:                                      ; preds = %NodeBlock.15
-;CHECK-NEXT:  %Pivot.14 = icmp slt i32 %tmp158, 15
-;CHECK-NEXT:  br i1 %Pivot.14, label %bb332, label %LeafBlock.11
+;CHECK:     NodeBlock13:                                      ; preds = %NodeBlock15
+;CHECK-NEXT:  %Pivot14 = icmp slt i32 %tmp158, 15
+;CHECK-NEXT:  br i1 %Pivot14, label %bb332, label %LeafBlock11
 
 
-;CHECK:     LeafBlock.11:                                      ; preds = %NodeBlock.13
+;CHECK:     LeafBlock11:                                      ; preds = %NodeBlock13
 ;CHECK-NEXT:  %SwitchLeaf12 = icmp eq i32 %tmp158, 15
 ;CHECK-NEXT:  %SwitchLeaf12 = icmp eq i32 %tmp158, 15
 ;CHECK-NEXT:  br i1 %SwitchLeaf12, label %bb334, label %NewDefault
 ;CHECK-NEXT:  br i1 %SwitchLeaf12, label %bb334, label %NewDefault
 
 
-;CHECK:     NodeBlock.9:                                       ; preds = %NodeBlock.17
-;CHECK-NEXT:  %Pivot.10 = icmp slt i32 %tmp158, 11
-;CHECK-NEXT:  br i1 %Pivot.10, label %bb324, label %NodeBlock.7
+;CHECK:     NodeBlock9:                                       ; preds = %NodeBlock17
+;CHECK-NEXT:  %Pivot10 = icmp slt i32 %tmp158, 11
+;CHECK-NEXT:  br i1 %Pivot10, label %bb324, label %NodeBlock7
 
 
-;CHECK:     NodeBlock.7:                                       ; preds = %NodeBlock.9
-;CHECK-NEXT:  %Pivot.8 = icmp slt i32 %tmp158, 12
-;CHECK-NEXT:  br i1 %Pivot.8, label %bb326, label %bb328
+;CHECK:     NodeBlock7:                                       ; preds = %NodeBlock9
+;CHECK-NEXT:  %Pivot8 = icmp slt i32 %tmp158, 12
+;CHECK-NEXT:  br i1 %Pivot8, label %bb326, label %bb328
 
 
-;CHECK:     NodeBlock.5:                                       ; preds = %NodeBlock.19
-;CHECK-NEXT:  %Pivot.6 = icmp slt i32 %tmp158, 7
-;CHECK-NEXT:  br i1 %Pivot.6, label %NodeBlock, label %NodeBlock.3
+;CHECK:     NodeBlock5:                                       ; preds = %NodeBlock19
+;CHECK-NEXT:  %Pivot6 = icmp slt i32 %tmp158, 7
+;CHECK-NEXT:  br i1 %Pivot6, label %NodeBlock, label %NodeBlock3
 
 
-;CHECK:     NodeBlock.3:                                       ; preds = %NodeBlock.5
-;CHECK-NEXT:  %Pivot.4 = icmp slt i32 %tmp158, 8
-;CHECK-NEXT:  br i1 %Pivot.4, label %bb, label %NodeBlock.1
+;CHECK:     NodeBlock3:                                       ; preds = %NodeBlock5
+;CHECK-NEXT:  %Pivot4 = icmp slt i32 %tmp158, 8
+;CHECK-NEXT:  br i1 %Pivot4, label %bb, label %NodeBlock1
 
 
-;CHECK:     NodeBlock.1:                                       ; preds = %NodeBlock.3
-;CHECK-NEXT:  %Pivot.2 = icmp slt i32 %tmp158, 9
-;CHECK-NEXT:  br i1 %Pivot.2, label %bb338, label %bb322
+;CHECK:     NodeBlock1:                                       ; preds = %NodeBlock3
+;CHECK-NEXT:  %Pivot2 = icmp slt i32 %tmp158, 9
+;CHECK-NEXT:  br i1 %Pivot2, label %bb338, label %bb322
 
 
-;CHECK:     NodeBlock:                                        ; preds = %NodeBlock.5
+;CHECK:     NodeBlock:                                        ; preds = %NodeBlock5
 ;CHECK-NEXT:  %Pivot = icmp slt i32 %tmp158, 0
 ;CHECK-NEXT:  %Pivot = icmp slt i32 %tmp158, 0
 ;CHECK-NEXT:  br i1 %Pivot, label %LeafBlock, label %bb338
 ;CHECK-NEXT:  br i1 %Pivot, label %LeafBlock, label %bb338
 
 

+ 1 - 1
test/Transforms/PlaceSafepoints/basic.ll

@@ -74,7 +74,7 @@ define i1 @test_call_with_result() gc "statepoint-example" {
 ; CHECK: gc.statepoint.p0f_isVoidf
 ; CHECK: gc.statepoint.p0f_isVoidf
 ; CHECK: gc.statepoint.p0f_i1i1f
 ; CHECK: gc.statepoint.p0f_i1i1f
 ; CHECK: (i64 2882400000, i32 0, i1 (i1)* @i1_return_i1, i32 1, i32 0, i1 false, i32 0, i32 0)
 ; CHECK: (i64 2882400000, i32 0, i1 (i1)* @i1_return_i1, i32 1, i32 0, i1 false, i32 0, i32 0)
-; CHECK: %call1.2 = call i1 @llvm.experimental.gc.result.i1
+; CHECK: %call12 = call i1 @llvm.experimental.gc.result.i1
 entry:
 entry:
   %call1 = tail call i1 (i1) @i1_return_i1(i1 false)
   %call1 = tail call i1 (i1) @i1_return_i1(i1 false)
   ret i1 %call1
   ret i1 %call1

+ 2 - 2
test/Transforms/PlaceSafepoints/call_gc_result.ll

@@ -21,8 +21,8 @@ branch2:
 
 
 merge:
 merge:
 ;; CHECK: 		%phi = phi i32 [ %a, %branch2 ], [ %b, %branch1 ]
 ;; CHECK: 		%phi = phi i32 [ %a, %branch2 ], [ %b, %branch1 ]
-;; CHECK-NEXT:  %safepoint_token.1 = call i32 (i64, i32, i32 ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_i32f(i64 2882400000, i32 0, i32 ()* @foo, i32 0, i32 0, i32 0, i32 0)
-;; CHECK-NEXT:  %ret.2 = call i32 @llvm.experimental.gc.result.i32(i32 %safepoint_token.1)
+;; CHECK-NEXT:  %safepoint_token1 = call i32 (i64, i32, i32 ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_i32f(i64 2882400000, i32 0, i32 ()* @foo, i32 0, i32 0, i32 0, i32 0)
+;; CHECK-NEXT:  %ret2 = call i32 @llvm.experimental.gc.result.i32(i32 %safepoint_token1)
   %phi = phi i32 [ %a, %branch2 ], [ %b, %branch1 ]
   %phi = phi i32 [ %a, %branch2 ], [ %b, %branch1 ]
   %ret = call i32 @foo()
   %ret = call i32 @foo()
   ret i32 %ret
   ret i32 %ret

+ 1 - 1
test/Transforms/RewriteStatepointsForGC/deopt-bundles/rewrite-invoke.ll

@@ -26,7 +26,7 @@ unwind_dest:
 
 
 normal_dest:
 normal_dest:
 ; CHECK: normal_dest:
 ; CHECK: normal_dest:
-; CHECK-NEXT: %merge = phi i8 addrspace(1)* [ null, %entry ], [ %obj.2, %normal_dest1 ]
+; CHECK-NEXT: %merge = phi i8 addrspace(1)* [ null, %entry ], [ %obj2, %normal_dest1 ]
   %merge = phi i8 addrspace(1)* [ null, %entry ], [ %obj, %gc_invoke ]
   %merge = phi i8 addrspace(1)* [ null, %entry ], [ %obj, %gc_invoke ]
   ret i8 addrspace(1)* %merge
   ret i8 addrspace(1)* %merge
 }
 }

+ 1 - 1
test/Transforms/RewriteStatepointsForGC/relocation.ll

@@ -94,7 +94,7 @@ join:
 ; CHECK-LABEL: join:
 ; CHECK-LABEL: join:
 ; CHECK: phi i8 addrspace(1)*
 ; CHECK: phi i8 addrspace(1)*
 ; CHECK-DAG: [ %arg.relocated, %if_branch ]
 ; CHECK-DAG: [ %arg.relocated, %if_branch ]
-; CHECK-DAG: [ %arg.relocated3, %else_branch ]
+; CHECK-DAG: [ %arg.relocated4, %else_branch ]
 ; CHECK-NOT: phi
 ; CHECK-NOT: phi
   call void (i8 addrspace(1)*) @some_call(i8 addrspace(1)* %arg)
   call void (i8 addrspace(1)*) @some_call(i8 addrspace(1)* %arg)
   ret void
   ret void

+ 3 - 3
test/Transforms/Util/lowerswitch.ll

@@ -3,7 +3,7 @@
 ; Test that we don't crash and have a different basic block for each incoming edge.
 ; Test that we don't crash and have a different basic block for each incoming edge.
 define void @test0() {
 define void @test0() {
 ; CHECK-LABEL: @test0
 ; CHECK-LABEL: @test0
-; CHECK: %merge = phi i64 [ 1, %BB3 ], [ 0, %NewDefault ], [ 0, %NodeBlock.5 ], [ 0, %LeafBlock.1 ]
+; CHECK: %merge = phi i64 [ 1, %BB3 ], [ 0, %NewDefault ], [ 0, %NodeBlock5 ], [ 0, %LeafBlock1 ]
 BB1:
 BB1:
   switch i32 undef, label %BB2 [
   switch i32 undef, label %BB2 [
     i32 3, label %BB2
     i32 3, label %BB2
@@ -43,9 +43,9 @@ bb2:
 
 
 bb3:
 bb3:
 ; CHECK-LABEL: bb3
 ; CHECK-LABEL: bb3
-; CHECK: %tmp = phi i32 [ 1, %NodeBlock ], [ 0, %bb2 ], [ 1, %LeafBlock.3 ]
+; CHECK: %tmp = phi i32 [ 1, %NodeBlock ], [ 0, %bb2 ], [ 1, %LeafBlock3 ]
   %tmp = phi i32 [ 1, %bb1 ], [ 0, %bb2 ], [ 1, %bb1 ], [ 1, %bb1 ]
   %tmp = phi i32 [ 1, %bb1 ], [ 0, %bb2 ], [ 1, %bb1 ], [ 1, %bb1 ]
-; CHECK-NEXT: %tmp2 = phi i32 [ 2, %NodeBlock ], [ 5, %bb2 ], [ 2, %LeafBlock.3 ]
+; CHECK-NEXT: %tmp2 = phi i32 [ 2, %NodeBlock ], [ 5, %bb2 ], [ 2, %LeafBlock3 ]
   %tmp2 = phi i32 [ 2, %bb1 ], [ 2, %bb1 ], [ 5, %bb2 ], [ 2, %bb1 ]
   %tmp2 = phi i32 [ 2, %bb1 ], [ 2, %bb1 ], [ 5, %bb2 ], [ 2, %bb1 ]
   br label %exit
   br label %exit
 
 

+ 6 - 6
test/tools/gold/X86/comdat.ll

@@ -35,7 +35,7 @@ bb11:
 ; CHECK: @r21 = global i32* @v1{{$}}
 ; CHECK: @r21 = global i32* @v1{{$}}
 ; CHECK: @r22 = global i32 (i8*)* @f1{{$}}
 ; CHECK: @r22 = global i32 (i8*)* @f1{{$}}
 
 
-; CHECK: @v11 = internal global i32 41, comdat($c2)
+; CHECK: @v1.1 = internal global i32 41, comdat($c2)
 
 
 ; CHECK: @a11 = alias i32, i32* @v1{{$}}
 ; CHECK: @a11 = alias i32, i32* @v1{{$}}
 ; CHECK: @a12 = alias i16, bitcast (i32* @v1 to i16*)
 ; CHECK: @a12 = alias i16, bitcast (i32* @v1 to i16*)
@@ -43,11 +43,11 @@ bb11:
 ; CHECK: @a13 = alias i32 (i8*), i32 (i8*)* @f1{{$}}
 ; CHECK: @a13 = alias i32 (i8*), i32 (i8*)* @f1{{$}}
 ; CHECK: @a14 = alias i16, bitcast (i32 (i8*)* @f1 to i16*)
 ; CHECK: @a14 = alias i16, bitcast (i32 (i8*)* @f1 to i16*)
 
 
-; CHECK: @a21 = alias i32, i32* @v11{{$}}
-; CHECK: @a22 = alias i16, bitcast (i32* @v11 to i16*)
+; CHECK: @a21 = alias i32, i32* @v1.1{{$}}
+; CHECK: @a22 = alias i16, bitcast (i32* @v1.1 to i16*)
 
 
-; CHECK: @a23 = alias i32 (i8*), i32 (i8*)* @f12{{$}}
-; CHECK: @a24 = alias i16, bitcast (i32 (i8*)* @f12 to i16*)
+; CHECK: @a23 = alias i32 (i8*), i32 (i8*)* @f1.2{{$}}
+; CHECK: @a24 = alias i16, bitcast (i32 (i8*)* @f1.2 to i16*)
 
 
 ; CHECK:      define weak_odr protected i32 @f1(i8*) comdat($c1) {
 ; CHECK:      define weak_odr protected i32 @f1(i8*) comdat($c1) {
 ; CHECK-NEXT: bb10:
 ; CHECK-NEXT: bb10:
@@ -56,7 +56,7 @@ bb11:
 ; CHECK-NEXT:   ret i32 42
 ; CHECK-NEXT:   ret i32 42
 ; CHECK-NEXT: }
 ; CHECK-NEXT: }
 
 
-; CHECK:      define internal i32 @f12(i8* %this) comdat($c2) {
+; CHECK:      define internal i32 @f1.2(i8* %this) comdat($c2) {
 ; CHECK-NEXT: bb20:
 ; CHECK-NEXT: bb20:
 ; CHECK-NEXT:   store i8* %this, i8** null
 ; CHECK-NEXT:   store i8* %this, i8** null
 ; CHECK-NEXT:   br label %bb21
 ; CHECK-NEXT:   br label %bb21

+ 3 - 3
test/tools/llvm-split/unnamed.ll

@@ -10,8 +10,8 @@ define internal void @0() {
   ret void
   ret void
 }
 }
 
 
-; CHECK0: declare hidden void @__llvmsplit_unnamed1()
-; CHECK1: define hidden void @__llvmsplit_unnamed1()
+; CHECK0: declare hidden void @__llvmsplit_unnamed.1()
+; CHECK1: define hidden void @__llvmsplit_unnamed.1()
 define internal void @1() {
 define internal void @1() {
   ; CHECK1: call void @foo()
   ; CHECK1: call void @foo()
   ; CHECK1: call void @foo()
   ; CHECK1: call void @foo()
@@ -23,7 +23,7 @@ define internal void @1() {
 ; CHECK0: define void @foo()
 ; CHECK0: define void @foo()
 ; CHECK1: declare void @foo()
 ; CHECK1: declare void @foo()
 define void @foo() {
 define void @foo() {
-  ; CHECK0: call void @__llvmsplit_unnamed1()
+  ; CHECK0: call void @__llvmsplit_unnamed.1()
   ; CHECK0: call void @__llvmsplit_unnamed()
   ; CHECK0: call void @__llvmsplit_unnamed()
   call void @1()
   call void @1()
   call void @0()
   call void @0()