llvm.org GIT mirror llvm / a2197f8
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 3 years ago
23 changed file(s) with 106 addition(s) and 111 deletion(s). Raw diff Collapse all Expand all
1313 #ifndef LLVM_IR_VALUESYMBOLTABLE_H
1414 #define LLVM_IR_VALUESYMBOLTABLE_H
1515
16 #include "llvm/ADT/SmallString.h"
1617 #include "llvm/ADT/StringMap.h"
1718 #include "llvm/IR/Value.h"
1819 #include "llvm/Support/DataTypes.h"
9899 /// @name Mutators
99100 /// @{
100101 private:
102 ValueName *makeUniqueName(Value *V, SmallString<256> &UniqueName);
103
101104 /// This method adds the provided value \p N to the symbol table. The Value
102105 /// must have a name which is used to place the value in the symbol table.
103106 /// If the inserted name conflicts, this renames the value.
3131 #endif
3232 }
3333
34 ValueName *ValueSymbolTable::makeUniqueName(Value *V,
35 SmallString<256> &UniqueName) {
36 unsigned BaseSize = UniqueName.size();
37 while (1) {
38 // Trim any suffix off and append the next number.
39 UniqueName.resize(BaseSize);
40 raw_svector_ostream S(UniqueName);
41 if (isa(V))
42 S << ".";
43 S << ++LastUnique;
44
45 // Try insert the vmap entry with this suffix.
46 auto IterBool = vmap.insert(std::make_pair(UniqueName, V));
47 if (IterBool.second)
48 return &*IterBool.first;
49 }
50 }
51
3452 // Insert a value into the symbol table with the specified name...
3553 //
3654 void ValueSymbolTable::reinsertValue(Value* V) {
4866 // The name is too already used, just free it so we can allocate a new name.
4967 V->getValueName()->Destroy();
5068
51 unsigned BaseSize = UniqueName.size();
52 while (1) {
53 // Trim any suffix off and append the next number.
54 UniqueName.resize(BaseSize);
55 raw_svector_ostream(UniqueName) << "." << ++LastUnique;
56
57 // Try insert the vmap entry with this suffix.
58 auto IterBool = vmap.insert(std::make_pair(UniqueName, V));
59 if (IterBool.second) {
60 // Newly inserted name. Success!
61 V->setValueName(&*IterBool.first);
62 //DEBUG(dbgs() << " Inserted value: " << UniqueName << ": " << *V << "\n");
63 return;
64 }
65 }
69 ValueName *VN = makeUniqueName(V, UniqueName);
70 V->setValueName(VN);
6671 }
6772
6873 void ValueSymbolTable::removeValueName(ValueName *V) {
8590
8691 // Otherwise, there is a naming conflict. Rename this value.
8792 SmallString<256> UniqueName(Name.begin(), Name.end());
88
89 while (1) {
90 // Trim any suffix off and append the next number.
91 UniqueName.resize(Name.size());
92 raw_svector_ostream(UniqueName) << ++LastUnique;
93
94 // Try insert the vmap entry with this suffix.
95 auto IterBool = vmap.insert(std::make_pair(UniqueName, V));
96 if (IterBool.second) {
97 // DEBUG(dbgs() << " Inserted value: " << UniqueName << ": " << *V <<
98 // "\n");
99 return &*IterBool.first;
100 }
101 }
93 return makeUniqueName(V, UniqueName);
10294 }
10395
10496
66 ; PTX32-NOT: .str
77 ; PTX64-NOT: .str
88
9 ; PTX32-DAG: _$_str1
9 ; PTX32-DAG: _$_str.1
1010 ; PTX32-DAG: _$_str
1111
12 ; PTX64-DAG: _$_str1
12 ; PTX64-DAG: _$_str.1
1313 ; PTX64-DAG: _$_str
1414
1515 target datalayout = "e-i64:64-v16:16-v32:32-n16:32:64"
11 ; RUN: llvm-as %s -o %t.2.bc
22 ; RUN: llvm-link %t.1.bc %t.2.bc -S | FileCheck %s
33
4 ; CHECK: @bar = global i32 ()* @foo2
4 ; CHECK: @bar = global i32 ()* @foo.2
55
6 ; CHECK: define internal i32 @foo2() {
6 ; CHECK: define internal i32 @foo.2() {
77 ; CHECK-NEXT: ret i32 7
88 ; CHECK-NEXT: }
99
11 ; RUN: llvm-as %s -o %t.2.bc
22 ; RUN: llvm-link %t.1.bc %t.2.bc -S | FileCheck %s
33
4 ; CHECK: @bar = global i32 ()* @foo2
4 ; CHECK: @bar = global i32 ()* @foo.2
55
6 ; CHECK: define internal i32 @foo2() {
6 ; CHECK: define internal i32 @foo.2() {
77 ; CHECK-NEXT: ret i32 7
88 ; CHECK-NEXT: }
99
22
33 ; CHECK-LABEL: define i32 @main(
44 ; CHECK-NEXT: entry:
5 ; CHECK-NEXT: call i32 @foo2(
5 ; CHECK-NEXT: call i32 @foo.2(
66 define i32 @main(i32 %argc, i8** %argv) {
77 entry:
88 %a = call i32 @foo(i32 2)
99 ret i32 %a
1010 }
1111
12 ; CHECK-LABEL: define internal i32 @foo2(
12 ; CHECK-LABEL: define internal i32 @foo.2(
1313 ; CHECK-NEXT: entry:
1414 ; CHECK-NEXT: %add = add nsw i32 %i, %i
1515 ; CHECK-NEXT: ret i32 %add
4242
4343 ; This should get renamed since there is a definition that is non-internal in
4444 ; the other module.
45 ; CHECK-DAG: @Intern2{{[0-9]+}} = internal constant i32 792
45 ; CHECK-DAG: @Intern2.{{[0-9]+}} = internal constant i32 792
4646 @Intern2 = internal constant i32 792
4747
4848 @UseIntern2 = global i32* @Intern2
33 ; Basic depth-3 chain
44 define double @test1(double %A1, double %A2, double %A3, double %B1, double %B2, double %B3) {
55 ; CHECK-LABEL: @test1(
6 ; CHECK: %X1.v.i1.1.1 = insertelement <3 x double> undef, double %B1, i32 0
7 ; CHECK: %X1.v.i1.2.2 = insertelement <3 x double> %X1.v.i1.1.1, double %B2, i32 1
8 ; CHECK: %X1.v.i1 = insertelement <3 x double> %X1.v.i1.2.2, double %B3, i32 2
9 ; CHECK: %X1.v.i0.1.3 = insertelement <3 x double> undef, double %A1, i32 0
10 ; CHECK: %X1.v.i0.2.4 = insertelement <3 x double> %X1.v.i0.1.3, double %A2, i32 1
11 ; CHECK: %X1.v.i0 = insertelement <3 x double> %X1.v.i0.2.4, double %A3, i32 2
6 ; CHECK: %X1.v.i1.11 = insertelement <3 x double> undef, double %B1, i32 0
7 ; CHECK: %X1.v.i1.22 = insertelement <3 x double> %X1.v.i1.11, double %B2, i32 1
8 ; CHECK: %X1.v.i1 = insertelement <3 x double> %X1.v.i1.22, double %B3, i32 2
9 ; CHECK: %X1.v.i0.13 = insertelement <3 x double> undef, double %A1, i32 0
10 ; CHECK: %X1.v.i0.24 = insertelement <3 x double> %X1.v.i0.13, double %A2, i32 1
11 ; CHECK: %X1.v.i0 = insertelement <3 x double> %X1.v.i0.24, double %A3, i32 2
1212 %X1 = fsub double %A1, %B1
1313 %X2 = fsub double %A2, %B2
1414 %X3 = fsub double %A3, %B3
2323 ; CHECK: %Z1 = fadd <3 x double> %Y1, %X1.v.i1
2424 %R1 = fmul double %Z1, %Z2
2525 %R = fmul double %R1, %Z3
26 ; CHECK: %Z1.v.r2.10 = extractelement <3 x double> %Z1, i32 2
26 ; CHECK: %Z1.v.r210 = extractelement <3 x double> %Z1, i32 2
2727 ; CHECK: %Z1.v.r1 = extractelement <3 x double> %Z1, i32 0
2828 ; CHECK: %Z1.v.r2 = extractelement <3 x double> %Z1, i32 1
2929 ; CHECK: %R1 = fmul double %Z1.v.r1, %Z1.v.r2
30 ; CHECK: %R = fmul double %R1, %Z1.v.r2.10
30 ; CHECK: %R = fmul double %R1, %Z1.v.r210
3131 ret double %R
3232 ; CHECK: ret double %R
3333 }
3333 ; CHECK: %arrayidx.i = getelementptr inbounds float, float* %a, i64 7
3434 ; CHECK: store float %1, float* %arrayidx.i, align 4, !noalias !16
3535 ; CHECK: %2 = load float, float* %a, align 4, !alias.scope !16, !noalias !17
36 ; CHECK: %arrayidx.i.i.1 = getelementptr inbounds float, float* %b, i64 5
37 ; CHECK: store float %2, float* %arrayidx.i.i.1, align 4, !alias.scope !21, !noalias !22
38 ; CHECK: %arrayidx1.i.i.2 = getelementptr inbounds float, float* %b, i64 8
39 ; CHECK: store float %2, float* %arrayidx1.i.i.2, align 4, !alias.scope !23, !noalias !24
36 ; CHECK: %arrayidx.i.i1 = getelementptr inbounds float, float* %b, i64 5
37 ; CHECK: store float %2, float* %arrayidx.i.i1, align 4, !alias.scope !21, !noalias !22
38 ; CHECK: %arrayidx1.i.i2 = getelementptr inbounds float, float* %b, i64 8
39 ; CHECK: store float %2, float* %arrayidx1.i.i2, align 4, !alias.scope !23, !noalias !24
4040 ; CHECK: %3 = load float, float* %a, align 4, !alias.scope !16
41 ; CHECK: %arrayidx.i.3 = getelementptr inbounds float, float* %b, i64 7
42 ; CHECK: store float %3, float* %arrayidx.i.3, align 4, !alias.scope !16
41 ; CHECK: %arrayidx.i3 = getelementptr inbounds float, float* %b, i64 7
42 ; CHECK: store float %3, float* %arrayidx.i3, align 4, !alias.scope !16
4343 ; CHECK: ret void
4444 ; CHECK: }
4545
6060 ; CHECK: %arrayidx.i = getelementptr inbounds float, float* %a, i64 7
6161 ; CHECK: store float %1, float* %arrayidx.i, align 4, !alias.scope !14, !noalias !13
6262 ; CHECK: %2 = load float, float* %c, align 4, !noalias !15
63 ; CHECK: %arrayidx.i.1 = getelementptr inbounds float, float* %a, i64 6
64 ; CHECK: store float %2, float* %arrayidx.i.1, align 4, !alias.scope !19, !noalias !20
63 ; CHECK: %arrayidx.i1 = getelementptr inbounds float, float* %a, i64 6
64 ; CHECK: store float %2, float* %arrayidx.i1, align 4, !alias.scope !19, !noalias !20
6565 ; CHECK: %arrayidx1.i = getelementptr inbounds float, float* %b, i64 8
6666 ; CHECK: store float %2, float* %arrayidx1.i, align 4, !alias.scope !20, !noalias !19
6767 ; CHECK: %3 = load float, float* %c, align 4
186186 %c2 = sext i8 %c1 to i32 ; [#uses=1]
187187 %RV = and i32 %c2, 255 ; [#uses=1]
188188 ret i32 %RV
189 ; CHECK: %c2.1 = and i32 %X, 255
190 ; CHECK: ret i32 %c2.1
189 ; CHECK: %c21 = and i32 %X, 255
190 ; CHECK: ret i32 %c21
191191 }
192192
193193 define i32 @test22(i32 %X) {
574574 ; CHECK: %0 = shl i8 %tmp4, 2
575575 ; CHECK: %tmp54 = and i8 %0, 16
576576 %tmp55 = xor i8 %tmp54, %tmp51
577 ; CHECK: ret i8 %tmp55.1
577 ; CHECK: ret i8 %tmp551
578578 ret i8 %tmp55
579579 }
580580
742742 %or = or i32 %shl, 7
743743 ret i32 %or
744744 ; CHECK-LABEL: @test57(
745 ; CHECK: %shl = shl i32 %shr.1, 4
745 ; CHECK: %shl = shl i32 %shr1, 4
746746 }
747747
748748
6262 ; CHECK-LABEL: @test7(
6363 ; CHECK-NEXT: %A1 = and i32 %A, 7
6464 ; CHECK-NEXT: %B1 = and i32 %B, 128
65 ; CHECK-NEXT: %C1.1 = or i32 %A1, %B1
66 ; CHECK-NEXT: ret i32 %C1.1
65 ; CHECK-NEXT: %C11 = or i32 %A1, %B1
66 ; CHECK-NEXT: ret i32 %C11
6767 %A1 = and i32 %A, 7 ; [#uses=1]
6868 %B1 = and i32 %B, 128 ; [#uses=1]
6969 %C1 = xor i32 %A1, %B1 ; [#uses=1]
9595 define i8 @test10(i8 %A) {
9696 ; CHECK-LABEL: @test10(
9797 ; CHECK-NEXT: %B = and i8 %A, 3
98 ; CHECK-NEXT: %C.1 = or i8 %B, 4
99 ; CHECK-NEXT: ret i8 %C.1
98 ; CHECK-NEXT: %C1 = or i8 %B, 4
99 ; CHECK-NEXT: ret i8 %C1
100100 %B = and i8 %A, 3 ; [#uses=1]
101101 %C = xor i8 %B, 4 ; [#uses=1]
102102 ret i8 %C
3333 ; CHECK-NEXT: br label %loop_begin.us1
3434
3535 ; CHECK: loop_begin.us1: ; preds = %loop_begin.backedge.us5, %.split.split.us
36 ; CHECK-NEXT: %var_val.us.2 = load i32, i32* %var
36 ; CHECK-NEXT: %var_val.us2 = load i32, i32* %var
3737 ; CHECK-NEXT: switch i32 2, label %default.us-lcssa.us-lcssa.us [
3838 ; CHECK-NEXT: i32 1, label %inc.us4
3939 ; CHECK-NEXT: i32 2, label %dec.us3
6464 ; CHECK-NEXT: br label %loop_begin.us1
6565
6666 ; CHECK: loop_begin.us1: ; preds = %loop_begin.backedge.us6, %.split.split.us
67 ; CHECK-NEXT: %var_val.us.2 = load i32, i32* %var
67 ; CHECK-NEXT: %var_val.us2 = load i32, i32* %var
6868 ; CHECK-NEXT: switch i32 %c, label %second_switch.us3 [
6969 ; CHECK-NEXT: i32 1, label %loop_begin.inc_crit_edge.us
7070 ; CHECK-NEXT: ]
33 ; On output we should got binary comparison tree. Check that all is fine.
44
55 ;CHECK: entry:
6 ;CHECK-NEXT: br label %NodeBlock.19
6 ;CHECK-NEXT: br label %NodeBlock19
77
8 ;CHECK: NodeBlock.19: ; preds = %entry
9 ;CHECK-NEXT: %Pivot.20 = icmp slt i32 %tmp158, 10
10 ;CHECK-NEXT: br i1 %Pivot.20, label %NodeBlock.5, label %NodeBlock.17
8 ;CHECK: NodeBlock19: ; preds = %entry
9 ;CHECK-NEXT: %Pivot20 = icmp slt i32 %tmp158, 10
10 ;CHECK-NEXT: br i1 %Pivot20, label %NodeBlock5, label %NodeBlock17
1111
12 ;CHECK: NodeBlock.17: ; preds = %NodeBlock.19
13 ;CHECK-NEXT: %Pivot.18 = icmp slt i32 %tmp158, 13
14 ;CHECK-NEXT: br i1 %Pivot.18, label %NodeBlock.9, label %NodeBlock.15
12 ;CHECK: NodeBlock17: ; preds = %NodeBlock19
13 ;CHECK-NEXT: %Pivot18 = icmp slt i32 %tmp158, 13
14 ;CHECK-NEXT: br i1 %Pivot18, label %NodeBlock9, label %NodeBlock15
1515
16 ;CHECK: NodeBlock.15: ; preds = %NodeBlock.17
17 ;CHECK-NEXT: %Pivot.16 = icmp slt i32 %tmp158, 14
18 ;CHECK-NEXT: br i1 %Pivot.16, label %bb330, label %NodeBlock.13
16 ;CHECK: NodeBlock15: ; preds = %NodeBlock17
17 ;CHECK-NEXT: %Pivot16 = icmp slt i32 %tmp158, 14
18 ;CHECK-NEXT: br i1 %Pivot16, label %bb330, label %NodeBlock13
1919
20 ;CHECK: NodeBlock.13: ; preds = %NodeBlock.15
21 ;CHECK-NEXT: %Pivot.14 = icmp slt i32 %tmp158, 15
22 ;CHECK-NEXT: br i1 %Pivot.14, label %bb332, label %LeafBlock.11
20 ;CHECK: NodeBlock13: ; preds = %NodeBlock15
21 ;CHECK-NEXT: %Pivot14 = icmp slt i32 %tmp158, 15
22 ;CHECK-NEXT: br i1 %Pivot14, label %bb332, label %LeafBlock11
2323
24 ;CHECK: LeafBlock.11: ; preds = %NodeBlock.13
24 ;CHECK: LeafBlock11: ; preds = %NodeBlock13
2525 ;CHECK-NEXT: %SwitchLeaf12 = icmp eq i32 %tmp158, 15
2626 ;CHECK-NEXT: br i1 %SwitchLeaf12, label %bb334, label %NewDefault
2727
28 ;CHECK: NodeBlock.9: ; preds = %NodeBlock.17
29 ;CHECK-NEXT: %Pivot.10 = icmp slt i32 %tmp158, 11
30 ;CHECK-NEXT: br i1 %Pivot.10, label %bb324, label %NodeBlock.7
28 ;CHECK: NodeBlock9: ; preds = %NodeBlock17
29 ;CHECK-NEXT: %Pivot10 = icmp slt i32 %tmp158, 11
30 ;CHECK-NEXT: br i1 %Pivot10, label %bb324, label %NodeBlock7
3131
32 ;CHECK: NodeBlock.7: ; preds = %NodeBlock.9
33 ;CHECK-NEXT: %Pivot.8 = icmp slt i32 %tmp158, 12
34 ;CHECK-NEXT: br i1 %Pivot.8, label %bb326, label %bb328
32 ;CHECK: NodeBlock7: ; preds = %NodeBlock9
33 ;CHECK-NEXT: %Pivot8 = icmp slt i32 %tmp158, 12
34 ;CHECK-NEXT: br i1 %Pivot8, label %bb326, label %bb328
3535
36 ;CHECK: NodeBlock.5: ; preds = %NodeBlock.19
37 ;CHECK-NEXT: %Pivot.6 = icmp slt i32 %tmp158, 7
38 ;CHECK-NEXT: br i1 %Pivot.6, label %NodeBlock, label %NodeBlock.3
36 ;CHECK: NodeBlock5: ; preds = %NodeBlock19
37 ;CHECK-NEXT: %Pivot6 = icmp slt i32 %tmp158, 7
38 ;CHECK-NEXT: br i1 %Pivot6, label %NodeBlock, label %NodeBlock3
3939
40 ;CHECK: NodeBlock.3: ; preds = %NodeBlock.5
41 ;CHECK-NEXT: %Pivot.4 = icmp slt i32 %tmp158, 8
42 ;CHECK-NEXT: br i1 %Pivot.4, label %bb, label %NodeBlock.1
40 ;CHECK: NodeBlock3: ; preds = %NodeBlock5
41 ;CHECK-NEXT: %Pivot4 = icmp slt i32 %tmp158, 8
42 ;CHECK-NEXT: br i1 %Pivot4, label %bb, label %NodeBlock1
4343
44 ;CHECK: NodeBlock.1: ; preds = %NodeBlock.3
45 ;CHECK-NEXT: %Pivot.2 = icmp slt i32 %tmp158, 9
46 ;CHECK-NEXT: br i1 %Pivot.2, label %bb338, label %bb322
44 ;CHECK: NodeBlock1: ; preds = %NodeBlock3
45 ;CHECK-NEXT: %Pivot2 = icmp slt i32 %tmp158, 9
46 ;CHECK-NEXT: br i1 %Pivot2, label %bb338, label %bb322
4747
48 ;CHECK: NodeBlock: ; preds = %NodeBlock.5
48 ;CHECK: NodeBlock: ; preds = %NodeBlock5
4949 ;CHECK-NEXT: %Pivot = icmp slt i32 %tmp158, 0
5050 ;CHECK-NEXT: br i1 %Pivot, label %LeafBlock, label %bb338
5151
7373 ; CHECK: gc.statepoint.p0f_isVoidf
7474 ; CHECK: gc.statepoint.p0f_i1i1f
7575 ; CHECK: (i64 2882400000, i32 0, i1 (i1)* @i1_return_i1, i32 1, i32 0, i1 false, i32 0, i32 0)
76 ; CHECK: %call1.2 = call i1 @llvm.experimental.gc.result.i1
76 ; CHECK: %call12 = call i1 @llvm.experimental.gc.result.i1
7777 entry:
7878 %call1 = tail call i1 (i1) @i1_return_i1(i1 false)
7979 ret i1 %call1
2020
2121 merge:
2222 ;; CHECK: %phi = phi i32 [ %a, %branch2 ], [ %b, %branch1 ]
23 ;; 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)
24 ;; CHECK-NEXT: %ret.2 = call i32 @llvm.experimental.gc.result.i32(i32 %safepoint_token.1)
23 ;; 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)
24 ;; CHECK-NEXT: %ret2 = call i32 @llvm.experimental.gc.result.i32(i32 %safepoint_token1)
2525 %phi = phi i32 [ %a, %branch2 ], [ %b, %branch1 ]
2626 %ret = call i32 @foo()
2727 ret i32 %ret
2525
2626 normal_dest:
2727 ; CHECK: normal_dest:
28 ; CHECK-NEXT: %merge = phi i8 addrspace(1)* [ null, %entry ], [ %obj.2, %normal_dest1 ]
28 ; CHECK-NEXT: %merge = phi i8 addrspace(1)* [ null, %entry ], [ %obj2, %normal_dest1 ]
2929 %merge = phi i8 addrspace(1)* [ null, %entry ], [ %obj, %gc_invoke ]
3030 ret i8 addrspace(1)* %merge
3131 }
9393 ; CHECK-LABEL: join:
9494 ; CHECK: phi i8 addrspace(1)*
9595 ; CHECK-DAG: [ %arg.relocated, %if_branch ]
96 ; CHECK-DAG: [ %arg.relocated3, %else_branch ]
96 ; CHECK-DAG: [ %arg.relocated4, %else_branch ]
9797 ; CHECK-NOT: phi
9898 call void (i8 addrspace(1)*) @some_call(i8 addrspace(1)* %arg)
9999 ret void
22 ; Test that we don't crash and have a different basic block for each incoming edge.
33 define void @test0() {
44 ; CHECK-LABEL: @test0
5 ; CHECK: %merge = phi i64 [ 1, %BB3 ], [ 0, %NewDefault ], [ 0, %NodeBlock.5 ], [ 0, %LeafBlock.1 ]
5 ; CHECK: %merge = phi i64 [ 1, %BB3 ], [ 0, %NewDefault ], [ 0, %NodeBlock5 ], [ 0, %LeafBlock1 ]
66 BB1:
77 switch i32 undef, label %BB2 [
88 i32 3, label %BB2
4242
4343 bb3:
4444 ; CHECK-LABEL: bb3
45 ; CHECK: %tmp = phi i32 [ 1, %NodeBlock ], [ 0, %bb2 ], [ 1, %LeafBlock.3 ]
45 ; CHECK: %tmp = phi i32 [ 1, %NodeBlock ], [ 0, %bb2 ], [ 1, %LeafBlock3 ]
4646 %tmp = phi i32 [ 1, %bb1 ], [ 0, %bb2 ], [ 1, %bb1 ], [ 1, %bb1 ]
47 ; CHECK-NEXT: %tmp2 = phi i32 [ 2, %NodeBlock ], [ 5, %bb2 ], [ 2, %LeafBlock.3 ]
47 ; CHECK-NEXT: %tmp2 = phi i32 [ 2, %NodeBlock ], [ 5, %bb2 ], [ 2, %LeafBlock3 ]
4848 %tmp2 = phi i32 [ 2, %bb1 ], [ 2, %bb1 ], [ 5, %bb2 ], [ 2, %bb1 ]
4949 br label %exit
5050
3434 ; CHECK: @r21 = global i32* @v1{{$}}
3535 ; CHECK: @r22 = global i32 (i8*)* @f1{{$}}
3636
37 ; CHECK: @v11 = internal global i32 41, comdat($c2)
37 ; CHECK: @v1.1 = internal global i32 41, comdat($c2)
3838
3939 ; CHECK: @a11 = alias i32, i32* @v1{{$}}
4040 ; CHECK: @a12 = alias i16, bitcast (i32* @v1 to i16*)
4242 ; CHECK: @a13 = alias i32 (i8*), i32 (i8*)* @f1{{$}}
4343 ; CHECK: @a14 = alias i16, bitcast (i32 (i8*)* @f1 to i16*)
4444
45 ; CHECK: @a21 = alias i32, i32* @v11{{$}}
46 ; CHECK: @a22 = alias i16, bitcast (i32* @v11 to i16*)
45 ; CHECK: @a21 = alias i32, i32* @v1.1{{$}}
46 ; CHECK: @a22 = alias i16, bitcast (i32* @v1.1 to i16*)
4747
48 ; CHECK: @a23 = alias i32 (i8*), i32 (i8*)* @f12{{$}}
49 ; CHECK: @a24 = alias i16, bitcast (i32 (i8*)* @f12 to i16*)
48 ; CHECK: @a23 = alias i32 (i8*), i32 (i8*)* @f1.2{{$}}
49 ; CHECK: @a24 = alias i16, bitcast (i32 (i8*)* @f1.2 to i16*)
5050
5151 ; CHECK: define weak_odr protected i32 @f1(i8*) comdat($c1) {
5252 ; CHECK-NEXT: bb10:
5555 ; CHECK-NEXT: ret i32 42
5656 ; CHECK-NEXT: }
5757
58 ; CHECK: define internal i32 @f12(i8* %this) comdat($c2) {
58 ; CHECK: define internal i32 @f1.2(i8* %this) comdat($c2) {
5959 ; CHECK-NEXT: bb20:
6060 ; CHECK-NEXT: store i8* %this, i8** null
6161 ; CHECK-NEXT: br label %bb21
99 ret void
1010 }
1111
12 ; CHECK0: declare hidden void @__llvmsplit_unnamed1()
13 ; CHECK1: define hidden void @__llvmsplit_unnamed1()
12 ; CHECK0: declare hidden void @__llvmsplit_unnamed.1()
13 ; CHECK1: define hidden void @__llvmsplit_unnamed.1()
1414 define internal void @1() {
1515 ; CHECK1: call void @foo()
1616 ; CHECK1: call void @foo()
2222 ; CHECK0: define void @foo()
2323 ; CHECK1: declare void @foo()
2424 define void @foo() {
25 ; CHECK0: call void @__llvmsplit_unnamed1()
25 ; CHECK0: call void @__llvmsplit_unnamed.1()
2626 ; CHECK0: call void @__llvmsplit_unnamed()
2727 call void @1()
2828 call void @0()