Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(937)

Side by Side Diff: test/CodeGen/JS/allocamanager-phis.ll

Issue 1692803002: Remove Emscripten support (Closed) Base URL: https://chromium.googlesource.com/a/native_client/pnacl-llvm.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « test/CodeGen/JS/allocamanager.ll ('k') | test/CodeGen/JS/asm.ll » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 ; RUN: llc < %s | FileCheck %s
2
3 ; Lifetime intrinsics are typically just referencing a single alloca, but
4 ; sometimes PRE decides to totally optimize a redundant bitcast and insert
5 ; phis. We need to look through the phis. In the code below, l_1565.i has
6 ; an overlapping lifetime with l_766.i which is only visible if we can
7 ; see through phis.
8
9 ; CHECK: $vararg_buffer3 = sp;
10 ; CHECK: $l_1565$i = sp + 16|0;
11 ; CHECK: $l_766$i = sp + 12|0;
12
13 target datalayout = "e-p:32:32-i64:64-v128:32:128-n32-S128"
14 target triple = "asmjs-unknown-emscripten"
15
16 @g_15 = external hidden global [4 x i8], align 4
17 @g_285 = external hidden global [4 x i8], align 4
18 @g_423 = external hidden global i32, align 4
19 @g_779 = external hidden global [4 x i8], align 4
20 @g_784 = external hidden global [4 x i8], align 4
21 @.str = external hidden unnamed_addr constant [25 x i8], align 1
22 @.str1 = external hidden unnamed_addr constant [25 x i8], align 1
23 @.str2 = external hidden unnamed_addr constant [15 x i8], align 1
24 @.str3 = external hidden unnamed_addr constant [8 x i8], align 1
25 @__func__._Z6func_6v = external hidden unnamed_addr constant [7 x i8], align 1
26
27 ; Function Attrs: nounwind
28 declare i32 @printf(i8* nocapture readonly, i8* noalias) #0
29
30 ; Function Attrs: noreturn
31 declare void @__assert_fail(i8*, i8*, i32, i8*) #1
32
33 define void @test() {
34 entry:
35 %vararg_buffer3 = alloca <{ i32*, i32**, i32* }>, align 8
36 %vararg_lifetime_bitcast4 = bitcast <{ i32*, i32**, i32* }>* %vararg_buffer3 t o i8*
37 %vararg_buffer = alloca <{ i32*, i32**, i32* }>, align 8
38 %vararg_lifetime_bitcast = bitcast <{ i32*, i32**, i32* }>* %vararg_buffer to i8*
39 %l_767.i.i = alloca i32, align 4
40 %l_1565.i = alloca i32*, align 4
41 %l_767.i = alloca i32, align 4
42 %l_766.i = alloca [1 x i16*], align 4
43 %0 = load i32, i32* bitcast ([4 x i8]* @g_15 to i32*), align 4
44 %tobool = icmp eq i32 %0, 0
45 br i1 %tobool, label %if.then, label %entry.if.end_crit_edge
46
47 entry.if.end_crit_edge: ; preds = %entry
48 %.pre = bitcast [1 x i16*]* %l_766.i to i8*
49 %.pre1 = getelementptr inbounds [1 x i16*], [1 x i16*]* %l_766.i, i32 0, i32 0
50 br label %if.end
51
52 if.then: ; preds = %entry
53 %1 = bitcast i32* %l_767.i to i8*
54 call void @llvm.lifetime.start(i64 4, i8* %1)
55 %2 = bitcast [1 x i16*]* %l_766.i to i8*
56 call void @llvm.lifetime.start(i64 4, i8* %2)
57 store i32 -1407759351, i32* %l_767.i, align 4
58 %3 = getelementptr inbounds [1 x i16*], [1 x i16*]* %l_766.i, i32 0, i32 0
59 store i16* null, i16** %3, align 4
60 br label %for.body.i
61
62 for.body.i: ; preds = %for.body.i, %if.the n
63 %l_82.02.i = phi i32 [ 0, %if.then ], [ %inc.i, %for.body.i ]
64 %4 = load i32**, i32*** bitcast (i32* @g_423 to i32***), align 4
65 store i32* %l_767.i, i32** %4, align 4
66 store i16** %3, i16*** bitcast ([4 x i8]* @g_779 to i16***), align 4
67 %inc.i = add i32 %l_82.02.i, 1
68 %exitcond.i = icmp eq i32 %inc.i, 27
69 br i1 %exitcond.i, label %_Z7func_34v.exit, label %for.body.i
70
71 _Z7func_34v.exit: ; preds = %for.body.i
72 call void @llvm.lifetime.end(i64 4, i8* %1)
73 call void @llvm.lifetime.end(i64 4, i8* %2)
74 %5 = load i32**, i32*** bitcast (i32* @g_423 to i32***), align 4
75 store i32* bitcast ([4 x i8]* @g_285 to i32*), i32** %5, align 4
76 br label %if.end
77
78 if.end: ; preds = %_Z7func_34v.exit, % entry.if.end_crit_edge
79 %.pre-phi2 = phi i16** [ %.pre1, %entry.if.end_crit_edge ], [ %3, %_Z7func_34v .exit ]
80 %.pre-phi = phi i8* [ %.pre, %entry.if.end_crit_edge ], [ %2, %_Z7func_34v.exi t ]
81 %6 = bitcast i32** %l_1565.i to i8*
82 call void @llvm.lifetime.start(i64 4, i8* %6)
83 store i32* bitcast ([4 x i8]* @g_784 to i32*), i32** %l_1565.i, align 4
84 call void @llvm.lifetime.start(i64 12, i8* %vararg_lifetime_bitcast)
85 %vararg_ptr = getelementptr <{ i32*, i32**, i32* }>, <{ i32*, i32**, i32* }>* %vararg_buffer, i32 0, i32 0
86 store i32* bitcast ([4 x i8]* @g_784 to i32*), i32** %vararg_ptr, align 4
87 %vararg_ptr1 = getelementptr <{ i32*, i32**, i32* }>, <{ i32*, i32**, i32* }>* %vararg_buffer, i32 0, i32 1
88 store i32** %l_1565.i, i32*** %vararg_ptr1, align 4
89 %vararg_ptr2 = getelementptr <{ i32*, i32**, i32* }>, <{ i32*, i32**, i32* }>* %vararg_buffer, i32 0, i32 2
90 store i32* bitcast ([4 x i8]* @g_784 to i32*), i32** %vararg_ptr2, align 4
91 %call.i = call i32 bitcast (i32 (i8*, i8*)* @printf to i32 (i8*, <{ i32*, i32* *, i32* }>*)*)(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i32 0, i 32 0), <{ i32*, i32**, i32* }>* %vararg_buffer)
92 call void @llvm.lifetime.end(i64 12, i8* %vararg_lifetime_bitcast)
93 %7 = bitcast i32* %l_767.i.i to i8*
94 call void @llvm.lifetime.start(i64 4, i8* %7)
95 call void @llvm.lifetime.start(i64 4, i8* %.pre-phi)
96 store i32 -1407759351, i32* %l_767.i.i, align 4
97 store i16* null, i16** %.pre-phi2, align 4
98 br label %for.body.i.i
99
100 for.body.i.i: ; preds = %for.body.i.i, %if.e nd
101 %l_82.02.i.i = phi i32 [ 0, %if.end ], [ %inc.i.i, %for.body.i.i ]
102 %8 = load i32**, i32*** bitcast (i32* @g_423 to i32***), align 4
103 store i32* %l_767.i.i, i32** %8, align 4
104 store i16** %.pre-phi2, i16*** bitcast ([4 x i8]* @g_779 to i16***), align 4
105 %inc.i.i = add i32 %l_82.02.i.i, 1
106 %exitcond.i.i = icmp eq i32 %inc.i.i, 27
107 br i1 %exitcond.i.i, label %_Z7func_34v.exit.i, label %for.body.i.i
108
109 _Z7func_34v.exit.i: ; preds = %for.body.i.i
110 call void @llvm.lifetime.end(i64 4, i8* %7)
111 call void @llvm.lifetime.end(i64 4, i8* %.pre-phi)
112 %9 = load i32*, i32** %l_1565.i, align 4
113 call void @llvm.lifetime.start(i64 12, i8* %vararg_lifetime_bitcast4)
114 %vararg_ptr5 = getelementptr <{ i32*, i32**, i32* }>, <{ i32*, i32**, i32* }>* %vararg_buffer3, i32 0, i32 0
115 store i32* %9, i32** %vararg_ptr5, align 4
116 %vararg_ptr6 = getelementptr <{ i32*, i32**, i32* }>, <{ i32*, i32**, i32* }>* %vararg_buffer3, i32 0, i32 1
117 store i32** %l_1565.i, i32*** %vararg_ptr6, align 4
118 %vararg_ptr7 = getelementptr <{ i32*, i32**, i32* }>, <{ i32*, i32**, i32* }>* %vararg_buffer3, i32 0, i32 2
119 store i32* bitcast ([4 x i8]* @g_784 to i32*), i32** %vararg_ptr7, align 4
120 %call1.i = call i32 bitcast (i32 (i8*, i8*)* @printf to i32 (i8*, <{ i32*, i32 **, i32* }>*)*)(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str1, i32 0, i32 0), <{ i32*, i32**, i32* }>* %vararg_buffer3)
121 call void @llvm.lifetime.end(i64 12, i8* %vararg_lifetime_bitcast4)
122 %10 = load i32*, i32** %l_1565.i, align 4
123 %cmp.i = icmp eq i32* %10, bitcast ([4 x i8]* @g_784 to i32*)
124 br i1 %cmp.i, label %_Z6func_6v.exit, label %lor.rhs.i
125
126 lor.rhs.i: ; preds = %_Z7func_34v.exit.i
127 call void @__assert_fail(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.s tr2, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str3, i32 0, i32 0), i32 33, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @__func__._Z6 func_6v, i32 0, i32 0)) #1
128 unreachable
129
130 _Z6func_6v.exit: ; preds = %_Z7func_34v.exit.i
131 call void @llvm.lifetime.end(i64 4, i8* %6)
132 ret void
133 }
134
135 ; Function Attrs: nounwind
136 declare void @llvm.lifetime.start(i64, i8* nocapture) #0
137
138 ; Function Attrs: nounwind
139 declare void @llvm.lifetime.end(i64, i8* nocapture) #0
140
141 attributes #0 = { nounwind }
142 attributes #1 = { noreturn }
OLDNEW
« no previous file with comments | « test/CodeGen/JS/allocamanager.ll ('k') | test/CodeGen/JS/asm.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698