blob: 99f736ee663ec712fb0150b8e564571fe30aae69 [file] [log] [blame]
Krzysztof Parzyszek18484de2018-03-06 19:15:58 +00001; RUN: llc -O2 -march=hexagon -mcpu=hexagonv62 < %s | FileCheck %s
Sumanth Gundapanenid428cf82016-11-14 17:11:00 +00002; CHECK: ParseFunc:
Krzysztof Parzyszeka72fad92017-02-10 15:33:13 +00003; CHECK: r[[ARG0:[0-9]+]] = memuh(r[[ARG1:[0-9]+]]+#[[OFFSET:[0-9]+]])
Sumanth Gundapanenid428cf82016-11-14 17:11:00 +00004; CHECK: memw(r[[ARG1]]+#[[OFFSET]]) = r[[ARG0]]
5
6@.str.3 = external unnamed_addr constant [8 x i8], align 1
7; Function Attrs: nounwind
8define void @ParseFunc() local_unnamed_addr #0 {
9entry:
10 %dataVar = alloca i32, align 4
11 %0 = load i32, i32* %dataVar, align 4
12 %and = and i32 %0, 65535
13 store i32 %and, i32* %dataVar, align 4
14 %.pr = load i32, i32* %dataVar, align 4
15 switch i32 %.pr, label %sw.epilog [
16 i32 4, label %sw.bb
17 i32 5, label %sw.bb
18 i32 1, label %sw.bb39
19 i32 2, label %sw.bb40
20 i32 3, label %sw.bb41
21 i32 6, label %sw.bb42
22 i32 7, label %sw.bb43
23 i32 13, label %sw.bb44
24 i32 0, label %sw.bb44
25 i32 14, label %sw.bb45
26 i32 15, label %sw.bb46
27 ]
28
29sw.bb:
30 %cmp1.i = icmp eq i32 %.pr, 4
31 br label %land.rhs.i
32
33land.rhs.i:
34 br label %ParseFuncNext.exit.i
35
36ParseFuncNext.exit.i:
37 br i1 %cmp1.i, label %if.then.i, label %if.else10.i
38
39if.then.i:
40 call void (i8*, i32, i8*, ...) @snprintf(i8* undef, i32 undef, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i32 0, i32 0), i32 undef) #2
41 br label %if.end27.i
42
43if.else10.i:
44 unreachable
45
46if.end27.i:
47 br label %land.rhs.i
48
49sw.bb39:
50 unreachable
51
52sw.bb40:
53 unreachable
54
55sw.bb41:
56 unreachable
57
58sw.bb42:
59 %1 = load i32, i32* undef, align 4
60 %shr.i = lshr i32 %1, 16
61 br label %while.cond.i.i
62
63while.cond.i.i:
64 %2 = load i8, i8* undef, align 1
65 switch i8 %2, label %if.then4.i [
66 i8 48, label %land.end.i.i
67 i8 120, label %land.end.i.i
68 i8 37, label %do.body.i.i
69 ]
70
71land.end.i.i:
72 unreachable
73
74do.body.i.i:
75 switch i8 undef, label %if.then4.i [
76 i8 117, label %if.end40.i.i
77 i8 120, label %if.end40.i.i
78 i8 88, label %if.end40.i.i
79 i8 100, label %if.end40.i.i
80 i8 105, label %if.end40.i.i
81 ]
82
83if.end40.i.i:
84 %trunc.i = trunc i32 %shr.i to i16
85 br label %land.rhs.i126
86
87if.then4.i:
88 unreachable
89
90land.rhs.i126:
91 switch i16 %trunc.i, label %sw.epilog.i [
92 i16 1, label %sw.bb.i
93 i16 2, label %sw.bb12.i
94 i16 4, label %sw.bb16.i
95 ]
96
97sw.bb.i:
98 unreachable
99
100sw.bb12.i:
101 unreachable
102
103sw.bb16.i:
104 unreachable
105
106sw.epilog.i:
107 call void (i8*, i32, i8*, ...) @snprintf(i8* undef, i32 undef, i8* nonnull undef, i32 undef) #2
108 br label %land.rhs.i126
109
110sw.bb43:
111 unreachable
112
113sw.bb44:
114 unreachable
115
116sw.bb45:
117 unreachable
118
119sw.bb46:
120 unreachable
121
122sw.epilog:
123 ret void
124}
125
126; Function Attrs: nounwind
127declare void @snprintf(i8* nocapture, i32, i8* nocapture readonly, ...) local_unnamed_addr #1
128
Sumanth Gundapanenie1983bc2017-10-18 18:07:07 +0000129attributes #0 = { nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="hexagonv62" "target-features"="+hvx,+hvx-length64b" "unsafe-fp-math"="false" "use-soft-float"="false" }
130attributes #1 = { nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="hexagonv62" "target-features"="+hvx,+hvx-length64b" "unsafe-fp-math"="false" "use-soft-float"="false" }
Sumanth Gundapanenid428cf82016-11-14 17:11:00 +0000131attributes #2 = { nounwind }
Sumanth Gundapanenie1983bc2017-10-18 18:07:07 +0000132