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

Side by Side Diff: test/CodeGen/JS/allocamanager.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/alloca-contradiction.ll ('k') | test/CodeGen/JS/allocamanager-phis.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 ; Basic AllocaManager feature test. Eliminate user variable cupcake in favor of
4 ; user variable muffin, and combine all the vararg buffers. And align the stack
5 ; pointer.
6
7 target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64 :64:64-p:32:32:32-v128:32:128-n32-S128"
8 target triple = "asmjs-unknown-emscripten"
9
10 %struct._IO_FILE = type opaque
11
12 @stderr = external constant [4 x i8], align 4
13 @.str = private unnamed_addr constant [26 x i8] c"hello from %s; argc is %d\00", align 1
14 @.str1 = private unnamed_addr constant [33 x i8] c"message from the program: \22 %s\22!\0A\00", align 1
15 @.str2 = private unnamed_addr constant [38 x i8] c"with argc %d, I, %s, must say goodbye\00", align 1
16 @.str3 = private unnamed_addr constant [43 x i8] c"another message from the prog ram: \22%s\22...\0A\00", align 1
17
18 ; CHECK: function _foo($argc,$argv) {
19 ; CHECK-NOT: cupcake
20 ; CHECK: STACKTOP = STACKTOP + 128|0;
21 ; CHECK-NEXT: vararg_buffer0 =
22 ; CHECK-NEXT: $muffin =
23 ; CHECK-NOT: cupcake
24 ; CHECK: }
25
26 ; Function Attrs: nounwind
27 define void @foo(i32 %argc, i8** %argv) #0 {
28 entry:
29 %vararg_buffer0 = alloca <{ i8* }>, align 8
30 %vararg_lifetime_bitcast10 = bitcast <{ i8* }>* %vararg_buffer0 to i8*
31 %vararg_buffer5 = alloca <{ i32, i8* }>, align 8
32 %vararg_lifetime_bitcast6 = bitcast <{ i32, i8* }>* %vararg_buffer5 to i8*
33 %vararg_buffer2 = alloca <{ i8* }>, align 8
34 %vararg_lifetime_bitcast3 = bitcast <{ i8* }>* %vararg_buffer2 to i8*
35 %vararg_buffer1 = alloca <{ i8*, i32 }>, align 8
36 %vararg_lifetime_bitcast = bitcast <{ i8*, i32 }>* %vararg_buffer1 to i8*
37 %muffin = alloca [117 x i8], align 1
38 %cupcake = alloca [119 x i8], align 1
39 %tmp = getelementptr [117 x i8], [117 x i8]* %muffin, i32 0, i32 0
40 call void @llvm.lifetime.start(i64 117, i8* %tmp) #0
41 %tmp1 = load i8*, i8** %argv, align 4
42 call void @llvm.lifetime.start(i64 8, i8* %vararg_lifetime_bitcast)
43 %vararg_ptr = getelementptr <{ i8*, i32 }>, <{ i8*, i32 }>* %vararg_buffer1, i 32 0, i32 0
44 store i8* %tmp1, i8** %vararg_ptr, align 4
45 %vararg_ptr1 = getelementptr <{ i8*, i32 }>, <{ i8*, i32 }>* %vararg_buffer1, i32 0, i32 1
46 store i32 %argc, i32* %vararg_ptr1, align 4
47 %call = call i32 bitcast (i32 (i8*, i8*, i8*)* @sprintf to i32 (i8*, i8*, <{ i 8*, i32 }>*)*)(i8* %tmp, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str , i32 0, i32 0), <{ i8*, i32 }>* %vararg_buffer1) #0
48 call void @llvm.lifetime.end(i64 8, i8* %vararg_lifetime_bitcast)
49 %tmp2 = load %struct._IO_FILE*, %struct._IO_FILE** bitcast ([4 x i8]* @stderr to %struct._IO_FILE**), align 4
50 call void @llvm.lifetime.start(i64 4, i8* %vararg_lifetime_bitcast3)
51 %vararg_ptr4 = getelementptr <{ i8* }>, <{ i8* }>* %vararg_buffer2, i32 0, i32 0
52 store i8* %tmp, i8** %vararg_ptr4, align 4
53 %call2 = call i32 bitcast (i32 (%struct._IO_FILE*, i8*, i8*)* @fprintf to i32 (%struct._IO_FILE*, i8*, <{ i8* }>*)*)(%struct._IO_FILE* %tmp2, i8* getelementpt r inbounds ([33 x i8], [33 x i8]* @.str1, i32 0, i32 0), <{ i8* }>* %vararg_buff er2) #0
54 call void @llvm.lifetime.end(i64 4, i8* %vararg_lifetime_bitcast3)
55 call void @llvm.lifetime.end(i64 117, i8* %tmp) #0
56 %tmp3 = getelementptr [119 x i8], [119 x i8]* %cupcake, i32 0, i32 0
57 call void @llvm.lifetime.start(i64 119, i8* %tmp3) #0
58 %tmp4 = load i8*, i8** %argv, align 4
59 call void @llvm.lifetime.start(i64 8, i8* %vararg_lifetime_bitcast6)
60 %vararg_ptr7 = getelementptr <{ i32, i8* }>, <{ i32, i8* }>* %vararg_buffer5, i32 0, i32 0
61 store i32 %argc, i32* %vararg_ptr7, align 4
62 %vararg_ptr8 = getelementptr <{ i32, i8* }>, <{ i32, i8* }>* %vararg_buffer5, i32 0, i32 1
63 store i8* %tmp4, i8** %vararg_ptr8, align 4
64 %call5 = call i32 bitcast (i32 (i8*, i8*, i8*)* @sprintf to i32 (i8*, i8*, <{ i32, i8* }>*)*)(i8* %tmp3, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.s tr2, i32 0, i32 0), <{ i32, i8* }>* %vararg_buffer5) #0
65 call void @llvm.lifetime.end(i64 8, i8* %vararg_lifetime_bitcast6)
66 call void @llvm.lifetime.start(i64 4, i8* %vararg_lifetime_bitcast10)
67 %vararg_ptr11 = getelementptr <{ i8* }>, <{ i8* }>* %vararg_buffer0, i32 0, i3 2 0
68 store i8* %tmp3, i8** %vararg_ptr11, align 4
69 %call7 = call i32 bitcast (i32 (%struct._IO_FILE*, i8*, i8*)* @fprintf to i32 (%struct._IO_FILE*, i8*, <{ i8* }>*)*)(%struct._IO_FILE* %tmp2, i8* getelementpt r inbounds ([43 x i8], [43 x i8]* @.str3, i32 0, i32 0), <{ i8* }>* %vararg_buff er0) #0
70 call void @llvm.lifetime.end(i64 4, i8* %vararg_lifetime_bitcast10)
71 call void @llvm.lifetime.end(i64 119, i8* %tmp3) #0
72 ret void
73 }
74
75 ; CHECK: function _bar($argc,$argv) {
76 ; CHECK-NOT: cupcake
77 ; CHECK: STACKTOP = STACKTOP + 128|0;
78 ; CHECK-NEXT: vararg_buffer0 =
79 ; CHECK-NEXT: $muffin =
80 ; CHECK-NOT: cupcake
81 ; CHECK: }
82
83 ; Function Attrs: nounwind
84 define void @bar(i32 %argc, i8** %argv) #0 {
85 entry:
86 %vararg_buffer0 = alloca <{ i8* }>, align 8
87 %vararg_lifetime_bitcast10 = bitcast <{ i8* }>* %vararg_buffer0 to i8*
88 %vararg_buffer5 = alloca <{ i32, i8* }>, align 8
89 %vararg_lifetime_bitcast6 = bitcast <{ i32, i8* }>* %vararg_buffer5 to i8*
90 %vararg_buffer2 = alloca <{ i8* }>, align 8
91 %vararg_lifetime_bitcast3 = bitcast <{ i8* }>* %vararg_buffer2 to i8*
92 %vararg_buffer1 = alloca <{ i8*, i32 }>, align 8
93 %vararg_lifetime_bitcast = bitcast <{ i8*, i32 }>* %vararg_buffer1 to i8*
94 %muffin = alloca [117 x i8], align 1
95 %cupcake = alloca [119 x i8], align 1
96 %tmp = getelementptr [117 x i8], [117 x i8]* %muffin, i32 0, i32 0
97 call void @llvm.lifetime.start(i64 117, i8* %tmp) #0
98 %cmp = icmp eq i32 %argc, 39
99 br i1 %cmp, label %if.end.thread, label %if.end
100
101 if.end.thread: ; preds = %entry
102 call void @llvm.lifetime.end(i64 117, i8* %tmp) #0
103 %tmp1 = getelementptr [119 x i8], [119 x i8]* %cupcake, i32 0, i32 0
104 call void @llvm.lifetime.start(i64 119, i8* %tmp1) #0
105 %.pre = load %struct._IO_FILE*, %struct._IO_FILE** bitcast ([4 x i8]* @stderr to %struct._IO_FILE**), align 4
106 br label %if.then4
107
108 if.end: ; preds = %entry
109 %tmp2 = load i8*, i8** %argv, align 4
110 call void @llvm.lifetime.start(i64 8, i8* %vararg_lifetime_bitcast)
111 %vararg_ptr = getelementptr <{ i8*, i32 }>, <{ i8*, i32 }>* %vararg_buffer1, i 32 0, i32 0
112 store i8* %tmp2, i8** %vararg_ptr, align 4
113 %vararg_ptr1 = getelementptr <{ i8*, i32 }>, <{ i8*, i32 }>* %vararg_buffer1, i32 0, i32 1
114 store i32 %argc, i32* %vararg_ptr1, align 4
115 %call = call i32 bitcast (i32 (i8*, i8*, i8*)* @sprintf to i32 (i8*, i8*, <{ i 8*, i32 }>*)*)(i8* %tmp, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str , i32 0, i32 0), <{ i8*, i32 }>* %vararg_buffer1) #0
116 call void @llvm.lifetime.end(i64 8, i8* %vararg_lifetime_bitcast)
117 %tmp3 = load %struct._IO_FILE*, %struct._IO_FILE** bitcast ([4 x i8]* @stderr to %struct._IO_FILE**), align 4
118 call void @llvm.lifetime.start(i64 4, i8* %vararg_lifetime_bitcast3)
119 %vararg_ptr4 = getelementptr <{ i8* }>, <{ i8* }>* %vararg_buffer2, i32 0, i32 0
120 store i8* %tmp, i8** %vararg_ptr4, align 4
121 %call2 = call i32 bitcast (i32 (%struct._IO_FILE*, i8*, i8*)* @fprintf to i32 (%struct._IO_FILE*, i8*, <{ i8* }>*)*)(%struct._IO_FILE* %tmp3, i8* getelementpt r inbounds ([33 x i8], [33 x i8]* @.str1, i32 0, i32 0), <{ i8* }>* %vararg_buff er2) #0
122 call void @llvm.lifetime.end(i64 4, i8* %vararg_lifetime_bitcast3)
123 call void @llvm.lifetime.end(i64 117, i8* %tmp) #0
124 %tmp4 = getelementptr [119 x i8], [119 x i8]* %cupcake, i32 0, i32 0
125 call void @llvm.lifetime.start(i64 119, i8* %tmp4) #0
126 %cmp3 = icmp eq i32 %argc, 45
127 br i1 %cmp3, label %if.end10, label %if.then4
128
129 if.then4: ; preds = %if.end, %if.end.thr ead
130 %tmp5 = phi %struct._IO_FILE* [ %.pre, %if.end.thread ], [ %tmp3, %if.end ]
131 %tmp6 = phi i8* [ %tmp1, %if.end.thread ], [ %tmp4, %if.end ]
132 %tmp7 = load i8*, i8** %argv, align 4
133 call void @llvm.lifetime.start(i64 8, i8* %vararg_lifetime_bitcast6)
134 %vararg_ptr7 = getelementptr <{ i32, i8* }>, <{ i32, i8* }>* %vararg_buffer5, i32 0, i32 0
135 store i32 %argc, i32* %vararg_ptr7, align 4
136 %vararg_ptr8 = getelementptr <{ i32, i8* }>, <{ i32, i8* }>* %vararg_buffer5, i32 0, i32 1
137 store i8* %tmp7, i8** %vararg_ptr8, align 4
138 %call7 = call i32 bitcast (i32 (i8*, i8*, i8*)* @sprintf to i32 (i8*, i8*, <{ i32, i8* }>*)*)(i8* %tmp6, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.s tr2, i32 0, i32 0), <{ i32, i8* }>* %vararg_buffer5) #0
139 call void @llvm.lifetime.end(i64 8, i8* %vararg_lifetime_bitcast6)
140 call void @llvm.lifetime.start(i64 4, i8* %vararg_lifetime_bitcast10)
141 %vararg_ptr11 = getelementptr <{ i8* }>, <{ i8* }>* %vararg_buffer0, i32 0, i3 2 0
142 store i8* %tmp6, i8** %vararg_ptr11, align 4
143 %call9 = call i32 bitcast (i32 (%struct._IO_FILE*, i8*, i8*)* @fprintf to i32 (%struct._IO_FILE*, i8*, <{ i8* }>*)*)(%struct._IO_FILE* %tmp5, i8* getelementpt r inbounds ([43 x i8], [43 x i8]* @.str3, i32 0, i32 0), <{ i8* }>* %vararg_buff er0) #0
144 call void @llvm.lifetime.end(i64 4, i8* %vararg_lifetime_bitcast10)
145 br label %if.end10
146
147 if.end10: ; preds = %if.then4, %if.end
148 %tmp8 = phi i8* [ %tmp4, %if.end ], [ %tmp6, %if.then4 ]
149 call void @llvm.lifetime.end(i64 119, i8* %tmp8) #0
150 ret void
151 }
152
153 ; Function Attrs: nounwind
154 declare i32 @sprintf(i8*, i8*, i8*) #0
155
156 ; Function Attrs: nounwind
157 declare i32 @fprintf(%struct._IO_FILE*, i8*, i8*) #0
158
159 ; Function Attrs: nounwind
160 declare void @llvm.lifetime.start(i64, i8* nocapture) #0
161
162 ; Function Attrs: nounwind
163 declare void @llvm.lifetime.end(i64, i8* nocapture) #0
164
165 attributes #0 = { nounwind }
OLDNEW
« no previous file with comments | « test/CodeGen/JS/alloca-contradiction.ll ('k') | test/CodeGen/JS/allocamanager-phis.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698