1; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 -verify-machineinstrs | FileCheck %s
2;
3; Test that foldMemoryOperandImpl() doesn't drop subreg / read-undef flags.
4
5
6define void @fun_llvm_stress_reduced(i8*, i32*, i64*, i64, i8) {
7; CHECK: .text
8BB:
9  %A4 = alloca <4 x i64>
10  %A1 = alloca <8 x i1>
11  %E6 = extractelement <4 x i1> undef, i32 3
12  %L23 = load i8, i8* %0
13  %B27 = fmul double 0x59A989483BA7E0C6, undef
14  %L30 = load i16, i16* undef
15  store i16 -11933, i16* undef
16  %L46 = load i16, i16* undef
17  %L61 = load i16, i16* undef
18  %Sl74 = select i1 undef, i1 undef, i1 true
19  br label %CF846
20
21CF846:                                            ; preds = %CF877, %BB
22  %I86 = insertelement <4 x i1> undef, i1 undef, i32 0
23  %Cmp89 = icmp ne i64 undef, %3
24  %L90 = load i16, i16* undef
25  %Shuff92 = shufflevector <4 x i16> zeroinitializer, <4 x i16> zeroinitializer, <4 x i32> <i32 0, i32 2, i32 undef, i32 6>
26  br label %CF877
27
28CF877:                                            ; preds = %CF846
29  store i16 %L61, i16* undef
30  %Cmp110 = icmp eq i16 %L61, undef
31  br i1 %Cmp110, label %CF846, label %CF862
32
33CF862:                                            ; preds = %CF877
34  %I114 = insertelement <4 x i64> zeroinitializer, i64 0, i32 0
35  %B115 = shl <4 x i64> zeroinitializer, %I114
36  %Sl124 = select i1 true, <8 x i1>* %A1, <8 x i1>* %A1
37  %B130 = frem double %B27, 0x59A989483BA7E0C6
38  %E143 = extractelement <4 x i64> %B115, i32 1
39  %Sl148 = select i1 %Cmp89, <1 x i32> undef, <1 x i32> zeroinitializer
40  br label %CF855
41
42CF855:                                            ; preds = %CF855, %CF862
43  %Sl171 = select i1 %Sl74, i1 %E6, i1 undef
44  br i1 %Sl171, label %CF855, label %CF874
45
46CF874:                                            ; preds = %CF855
47  %PC186 = bitcast i32* %1 to i16*
48  %L196 = load i16, i16* undef
49  %B207 = or i8 %4, %L23
50  %L211 = load <8 x i1>, <8 x i1>* %Sl124
51  %B215 = fdiv double 0x8421A9C0D21F6D3E, %B130
52  %L218 = load i16, i16* %PC186
53  %Sl223 = select i1 %Sl171, <4 x i1> %I86, <4 x i1> undef
54  br label %CF826
55
56CF826:                                            ; preds = %CF866, %CF910, %CF874
57  %B245 = ashr i16 -11933, %L46
58  br label %CF910
59
60CF910:                                            ; preds = %CF826
61  %L257 = load i8, i8* %0
62  %BC262 = bitcast i64 %E143 to double
63  store i16 %L196, i16* %PC186
64  %E266 = extractelement <4 x i16> %Shuff92, i32 0
65  %Sl271 = select i1 %Cmp89, i1 %Cmp89, i1 %Cmp110
66  br i1 %Sl271, label %CF826, label %CF866
67
68CF866:                                            ; preds = %CF910
69  store i64 %E143, i64* %2
70  %I276 = insertelement <4 x double> undef, double %BC262, i32 3
71  %L281 = load <8 x i1>, <8 x i1>* %Sl124
72  %E282 = extractelement <4 x i1> zeroinitializer, i32 2
73  br i1 %E282, label %CF826, label %CF848
74
75CF848:                                            ; preds = %CF866
76  %Cmp288 = fcmp olt <4 x double> undef, %I276
77  %FC294 = fptosi double undef to i16
78  %Cmp296 = icmp ule i16 %FC294, %B245
79  store i16 %L218, i16* undef
80  store i8 %L23, i8* %0
81  %E320 = extractelement <4 x i1> %Sl223, i32 1
82  %PC337 = bitcast <8 x i1>* %Sl124 to i1*
83  %Cmp345 = icmp uge <1 x i32> undef, %Sl148
84  store i16 %L196, i16* %PC186
85  br label %CF893
86
87CF893:                                            ; preds = %CF893, %CF848
88  %Cmp361 = fcmp uge float undef, undef
89  br i1 %Cmp361, label %CF893, label %CF906
90
91CF906:                                            ; preds = %CF893
92  store i16 -11933, i16* undef
93  %Shuff379 = shufflevector <1 x i1> undef, <1 x i1> %Cmp345, <1 x i32> <i32 1>
94  br label %CF850
95
96CF850:                                            ; preds = %CF850, %CF906
97  br i1 undef, label %CF850, label %CF925
98
99CF925:                                            ; preds = %CF850
100  store i16 %E266, i16* %PC186
101  %Cmp413 = icmp ugt i8 %L257, undef
102  store i16 %L30, i16* %PC186
103  %Sl420 = select i1 %Sl171, <8 x i1> undef, <8 x i1> %L281
104  store i16 %L90, i16* undef
105  %FC469 = uitofp i1 %Cmp296 to float
106  store i1 %Cmp413, i1* %PC337
107  br label %CF833
108
109CF833:                                            ; preds = %CF833, %CF925
110  store i8 %B207, i8* %0
111  %E509 = extractelement <8 x i1> %L211, i32 7
112  br i1 %E509, label %CF833, label %CF882
113
114CF882:                                            ; preds = %CF833
115  store i1 %Sl271, i1* %PC337
116  br label %CF852
117
118CF852:                                            ; preds = %CF896, %CF882
119  store i1 %Sl74, i1* %PC337
120  br label %CF896
121
122CF896:                                            ; preds = %CF852
123  %E576 = extractelement <4 x i1> %Cmp288, i32 3
124  br i1 %E576, label %CF852, label %CF890
125
126CF890:                                            ; preds = %CF896
127  %Sl581 = select i1 undef, float undef, float %FC469
128  unreachable
129}
130