1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4
2 ; RUN: opt < %s -passes=newgvn
3 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
4 %struct.S0 = type { [2 x i8], [2 x i8], [4 x i8], [2 x i8], i32, i32, i32, i32 }
5 define void @fn1(ptr byval(%struct.S0) align 8 %p1) {
7 for.cond: ; preds = %1, %0
9 %f2 = getelementptr inbounds %struct.S0, ptr %p1, i64 0, i32 2
10 %f9 = getelementptr inbounds %struct.S0, ptr %p1, i64 0, i32 7
12 for.end: ; preds = %for.cond
13 br i1 true, label %if.else, label %if.then
14 if.then: ; preds = %for.end
15 %f22 = getelementptr inbounds %struct.S0, ptr %p1, i64 0, i32 2
16 %f7 = getelementptr inbounds %struct.S0, ptr %p1, i64 0, i32 5
17 %tmp7 = load i32, ptr %f7, align 8
19 if.else: ; preds = %for.end
20 br i1 false, label %for.cond18, label %if.then6
21 if.then6: ; preds = %if.else
22 %f3 = getelementptr inbounds %struct.S0, ptr %p1, i64 0, i32 2
23 %f5 = getelementptr inbounds %struct.S0, ptr %p1, i64 0, i32 3
24 %bf.load13 = load i16, ptr %f5, align 8
26 for.cond18: ; preds = %if.else
28 br i1 true, label %if.end, label %if.end36
29 if.end: ; preds = %for.cond18
30 %f321 = getelementptr inbounds %struct.S0, ptr %p1, i64 0, i32 2
31 %f925 = getelementptr inbounds %struct.S0, ptr %p1, i64 0, i32 7
32 %f526 = getelementptr inbounds %struct.S0, ptr %p1, i64 0, i32 3
33 %bf.load27 = load i16, ptr %f526, align 8
35 if.end36: ; preds = %if.end, %for.cond18, %if.then6
36 %f537 = getelementptr inbounds %struct.S0, ptr %p1, i64 0, i32 3
37 %bf.load38 = load i16, ptr %f537, align 8
38 %bf.clear39 = and i16 %bf.load38, -16384
40 if.end40: ; preds = %if.end36, %if.then
41 %f6 = getelementptr inbounds %struct.S0, ptr %p1, i64 0, i32 4
42 %tmp18 = load i32, ptr %f6, align 4
43 call void @fn2(i32 %tmp18)
44 %f8 = getelementptr inbounds %struct.S0, ptr %p1, i64 0, i32 6
45 %tmp19 = load i32, ptr %f8, align 4
46 %tobool41 = icmp eq i32 %tmp19, 0
47 br i1 true, label %if.end50, label %if.then42
48 if.then42: ; preds = %if.end40
49 %f547 = getelementptr inbounds %struct.S0, ptr %p1, i64 0, i32 3
50 %bf.load48 = load i16, ptr %f547, align 8
52 if.end50: ; preds = %if.then42, %if.end40
53 %f551 = getelementptr inbounds %struct.S0, ptr %p1, i64 0, i32 3
54 %bf.load52 = load i16, ptr %f551, align 8
55 %bf.clear53 = and i16 %bf.load52, -16384
58 declare void @fn2(i32)