1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes
2; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal  -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=6 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM
3; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal  -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=6 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM
4; RUN: opt -attributor-cgscc -enable-new-pm=0 -attributor-manifest-internal  -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM
5; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal  -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM
6
7; Don't constant-propagate byval pointers, since they are not pointers!
8; PR5038
9%struct.MYstr = type { i8, i32 }
10@mystr = internal global %struct.MYstr zeroinitializer ; <%struct.MYstr*> [#uses=3]
11define internal void @vfu1(%struct.MYstr* byval(%struct.MYstr) align 4 %u) nounwind {
12; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
13; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@vfu1
14; IS__CGSCC_OPM-SAME: (%struct.MYstr* noalias nocapture nofree noundef nonnull writeonly byval(%struct.MYstr) align 8 dereferenceable(8) [[U:%.*]]) [[ATTR0:#.*]] {
15; IS__CGSCC_OPM-NEXT:  entry:
16; IS__CGSCC_OPM-NEXT:    [[TMP0:%.*]] = getelementptr [[STRUCT_MYSTR:%.*]], %struct.MYstr* [[U]], i32 0, i32 1
17; IS__CGSCC_OPM-NEXT:    store i32 99, i32* [[TMP0]], align 4
18; IS__CGSCC_OPM-NEXT:    [[TMP1:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U]], i32 0, i32 0
19; IS__CGSCC_OPM-NEXT:    store i8 97, i8* [[TMP1]], align 8
20; IS__CGSCC_OPM-NEXT:    br label [[RETURN:%.*]]
21; IS__CGSCC_OPM:       return:
22; IS__CGSCC_OPM-NEXT:    ret void
23;
24; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
25; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@vfu1
26; IS__CGSCC_NPM-SAME: (i8 [[TMP0:%.*]], i32 [[TMP1:%.*]]) [[ATTR0:#.*]] {
27; IS__CGSCC_NPM-NEXT:  entry:
28; IS__CGSCC_NPM-NEXT:    [[U_PRIV:%.*]] = alloca [[STRUCT_MYSTR:%.*]], align 8
29; IS__CGSCC_NPM-NEXT:    [[U_PRIV_CAST:%.*]] = bitcast %struct.MYstr* [[U_PRIV]] to i8*
30; IS__CGSCC_NPM-NEXT:    store i8 [[TMP0]], i8* [[U_PRIV_CAST]], align 8
31; IS__CGSCC_NPM-NEXT:    [[U_PRIV_0_1:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 1
32; IS__CGSCC_NPM-NEXT:    store i32 [[TMP1]], i32* [[U_PRIV_0_1]], align 4
33; IS__CGSCC_NPM-NEXT:    [[TMP2:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 1
34; IS__CGSCC_NPM-NEXT:    store i32 99, i32* [[TMP2]], align 4
35; IS__CGSCC_NPM-NEXT:    [[TMP3:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 0
36; IS__CGSCC_NPM-NEXT:    store i8 97, i8* [[TMP3]], align 8
37; IS__CGSCC_NPM-NEXT:    br label [[RETURN:%.*]]
38; IS__CGSCC_NPM:       return:
39; IS__CGSCC_NPM-NEXT:    ret void
40;
41entry:
42  %0 = getelementptr %struct.MYstr, %struct.MYstr* %u, i32 0, i32 1 ; <i32*> [#uses=1]
43  store i32 99, i32* %0, align 4
44  %1 = getelementptr %struct.MYstr, %struct.MYstr* %u, i32 0, i32 0 ; <i8*> [#uses=1]
45  store i8 97, i8* %1, align 4
46  br label %return
47
48return:                                           ; preds = %entry
49  ret void
50}
51
52define internal i32 @vfu2(%struct.MYstr* byval(%struct.MYstr) align 4 %u) nounwind readonly {
53; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readonly willreturn
54; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@vfu2
55; IS__TUNIT_OPM-SAME: (%struct.MYstr* noalias nocapture nofree noundef nonnull readonly byval(%struct.MYstr) align 8 dereferenceable(8) [[U:%.*]]) [[ATTR0:#.*]] {
56; IS__TUNIT_OPM-NEXT:  entry:
57; IS__TUNIT_OPM-NEXT:    [[TMP0:%.*]] = getelementptr [[STRUCT_MYSTR:%.*]], %struct.MYstr* @mystr, i32 0, i32 1
58; IS__TUNIT_OPM-NEXT:    [[TMP1:%.*]] = load i32, i32* [[TMP0]], align 4
59; IS__TUNIT_OPM-NEXT:    [[TMP2:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* @mystr, i32 0, i32 0
60; IS__TUNIT_OPM-NEXT:    [[TMP3:%.*]] = load i8, i8* [[TMP2]], align 8
61; IS__TUNIT_OPM-NEXT:    [[TMP4:%.*]] = zext i8 [[TMP3]] to i32
62; IS__TUNIT_OPM-NEXT:    [[TMP5:%.*]] = add i32 [[TMP4]], [[TMP1]]
63; IS__TUNIT_OPM-NEXT:    ret i32 [[TMP5]]
64;
65; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readonly willreturn
66; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@vfu2
67; IS__TUNIT_NPM-SAME: (i8 [[TMP0:%.*]], i32 [[TMP1:%.*]]) [[ATTR0:#.*]] {
68; IS__TUNIT_NPM-NEXT:  entry:
69; IS__TUNIT_NPM-NEXT:    [[U_PRIV:%.*]] = alloca [[STRUCT_MYSTR:%.*]], align 8
70; IS__TUNIT_NPM-NEXT:    [[U_PRIV_CAST:%.*]] = bitcast %struct.MYstr* [[U_PRIV]] to i8*
71; IS__TUNIT_NPM-NEXT:    store i8 [[TMP0]], i8* [[U_PRIV_CAST]], align 1
72; IS__TUNIT_NPM-NEXT:    [[U_PRIV_0_1:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 1
73; IS__TUNIT_NPM-NEXT:    store i32 [[TMP1]], i32* [[U_PRIV_0_1]], align 4
74; IS__TUNIT_NPM-NEXT:    [[TMP2:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* @mystr, i32 0, i32 1
75; IS__TUNIT_NPM-NEXT:    [[TMP3:%.*]] = load i32, i32* [[TMP2]], align 4
76; IS__TUNIT_NPM-NEXT:    [[TMP4:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* @mystr, i32 0, i32 0
77; IS__TUNIT_NPM-NEXT:    [[TMP5:%.*]] = load i8, i8* [[TMP4]], align 8
78; IS__TUNIT_NPM-NEXT:    [[TMP6:%.*]] = zext i8 [[TMP5]] to i32
79; IS__TUNIT_NPM-NEXT:    [[TMP7:%.*]] = add i32 [[TMP6]], [[TMP3]]
80; IS__TUNIT_NPM-NEXT:    ret i32 [[TMP7]]
81;
82; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readonly willreturn
83; IS__CGSCC____-LABEL: define {{[^@]+}}@vfu2
84; IS__CGSCC____-SAME: () [[ATTR1:#.*]] {
85; IS__CGSCC____-NEXT:  entry:
86; IS__CGSCC____-NEXT:    [[TMP0:%.*]] = getelementptr [[STRUCT_MYSTR:%.*]], %struct.MYstr* @mystr, i32 0, i32 1
87; IS__CGSCC____-NEXT:    [[TMP1:%.*]] = load i32, i32* [[TMP0]], align 4
88; IS__CGSCC____-NEXT:    [[TMP2:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* @mystr, i32 0, i32 0
89; IS__CGSCC____-NEXT:    [[TMP3:%.*]] = load i8, i8* [[TMP2]], align 8
90; IS__CGSCC____-NEXT:    [[TMP4:%.*]] = zext i8 [[TMP3]] to i32
91; IS__CGSCC____-NEXT:    [[TMP5:%.*]] = add i32 [[TMP4]], [[TMP1]]
92; IS__CGSCC____-NEXT:    ret i32 [[TMP5]]
93;
94entry:
95  %0 = getelementptr %struct.MYstr, %struct.MYstr* %u, i32 0, i32 1 ; <i32*> [#uses=1]
96  %1 = load i32, i32* %0
97  %2 = getelementptr %struct.MYstr, %struct.MYstr* %u, i32 0, i32 0 ; <i8*> [#uses=1]
98  %3 = load i8, i8* %2
99  %4 = zext i8 %3 to i32
100  %5 = add i32 %4, %1
101  ret i32 %5
102}
103
104define i32 @unions() nounwind {
105; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind willreturn
106; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@unions
107; IS__TUNIT_OPM-SAME: () [[ATTR1:#.*]] {
108; IS__TUNIT_OPM-NEXT:  entry:
109; IS__TUNIT_OPM-NEXT:    [[RESULT:%.*]] = call i32 @vfu2(%struct.MYstr* nocapture nofree noundef nonnull readonly byval(%struct.MYstr) align 8 dereferenceable(8) @mystr) [[ATTR0]]
110; IS__TUNIT_OPM-NEXT:    ret i32 [[RESULT]]
111;
112; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn
113; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@unions
114; IS__TUNIT_NPM-SAME: () [[ATTR1:#.*]] {
115; IS__TUNIT_NPM-NEXT:  entry:
116; IS__TUNIT_NPM-NEXT:    [[MYSTR_CAST:%.*]] = bitcast %struct.MYstr* @mystr to i8*
117; IS__TUNIT_NPM-NEXT:    [[TMP0:%.*]] = load i8, i8* [[MYSTR_CAST]], align 8
118; IS__TUNIT_NPM-NEXT:    [[MYSTR_0_1:%.*]] = getelementptr [[STRUCT_MYSTR:%.*]], %struct.MYstr* @mystr, i32 0, i32 1
119; IS__TUNIT_NPM-NEXT:    [[TMP1:%.*]] = load i32, i32* [[MYSTR_0_1]], align 8
120; IS__TUNIT_NPM-NEXT:    [[RESULT:%.*]] = call i32 @vfu2(i8 [[TMP0]], i32 [[TMP1]]) [[ATTR0]]
121; IS__TUNIT_NPM-NEXT:    ret i32 [[RESULT]]
122;
123; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readonly willreturn
124; IS__CGSCC____-LABEL: define {{[^@]+}}@unions
125; IS__CGSCC____-SAME: () [[ATTR1]] {
126; IS__CGSCC____-NEXT:  entry:
127; IS__CGSCC____-NEXT:    [[RESULT:%.*]] = call i32 @vfu2() [[ATTR2:#.*]]
128; IS__CGSCC____-NEXT:    ret i32 [[RESULT]]
129;
130entry:
131  call void @vfu1(%struct.MYstr* byval(%struct.MYstr) align 4 @mystr) nounwind
132  %result = call i32 @vfu2(%struct.MYstr* byval(%struct.MYstr) align 4 @mystr) nounwind
133  ret i32 %result
134}
135
136define internal i32 @vfu2_v2(%struct.MYstr* byval(%struct.MYstr) align 4 %u) nounwind readonly {
137; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn
138; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@vfu2_v2
139; IS__TUNIT_OPM-SAME: (%struct.MYstr* noalias nocapture nofree noundef nonnull byval(%struct.MYstr) align 8 dereferenceable(8) [[U:%.*]]) [[ATTR2:#.*]] {
140; IS__TUNIT_OPM-NEXT:  entry:
141; IS__TUNIT_OPM-NEXT:    [[Z:%.*]] = getelementptr [[STRUCT_MYSTR:%.*]], %struct.MYstr* [[U]], i32 0, i32 1
142; IS__TUNIT_OPM-NEXT:    store i32 99, i32* [[Z]], align 4
143; IS__TUNIT_OPM-NEXT:    [[TMP0:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U]], i32 0, i32 1
144; IS__TUNIT_OPM-NEXT:    [[TMP1:%.*]] = load i32, i32* [[TMP0]], align 4
145; IS__TUNIT_OPM-NEXT:    [[TMP2:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U]], i32 0, i32 0
146; IS__TUNIT_OPM-NEXT:    [[TMP3:%.*]] = load i8, i8* [[TMP2]], align 8
147; IS__TUNIT_OPM-NEXT:    [[TMP4:%.*]] = zext i8 [[TMP3]] to i32
148; IS__TUNIT_OPM-NEXT:    [[TMP5:%.*]] = add i32 [[TMP4]], [[TMP1]]
149; IS__TUNIT_OPM-NEXT:    ret i32 [[TMP5]]
150;
151; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn
152; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@vfu2_v2
153; IS__TUNIT_NPM-SAME: (i8 [[TMP0:%.*]], i32 [[TMP1:%.*]]) [[ATTR2:#.*]] {
154; IS__TUNIT_NPM-NEXT:  entry:
155; IS__TUNIT_NPM-NEXT:    [[U_PRIV:%.*]] = alloca [[STRUCT_MYSTR:%.*]], align 8
156; IS__TUNIT_NPM-NEXT:    [[U_PRIV_CAST:%.*]] = bitcast %struct.MYstr* [[U_PRIV]] to i8*
157; IS__TUNIT_NPM-NEXT:    store i8 [[TMP0]], i8* [[U_PRIV_CAST]], align 1
158; IS__TUNIT_NPM-NEXT:    [[U_PRIV_0_1:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 1
159; IS__TUNIT_NPM-NEXT:    store i32 [[TMP1]], i32* [[U_PRIV_0_1]], align 4
160; IS__TUNIT_NPM-NEXT:    [[Z:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 1
161; IS__TUNIT_NPM-NEXT:    store i32 99, i32* [[Z]], align 4
162; IS__TUNIT_NPM-NEXT:    [[TMP2:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 1
163; IS__TUNIT_NPM-NEXT:    [[TMP3:%.*]] = load i32, i32* [[TMP2]], align 4
164; IS__TUNIT_NPM-NEXT:    [[TMP4:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 0
165; IS__TUNIT_NPM-NEXT:    [[TMP5:%.*]] = load i8, i8* [[TMP4]], align 8
166; IS__TUNIT_NPM-NEXT:    [[TMP6:%.*]] = zext i8 [[TMP5]] to i32
167; IS__TUNIT_NPM-NEXT:    [[TMP7:%.*]] = add i32 [[TMP6]], [[TMP3]]
168; IS__TUNIT_NPM-NEXT:    ret i32 [[TMP7]]
169;
170; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
171; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@vfu2_v2
172; IS__CGSCC_OPM-SAME: (%struct.MYstr* noalias nocapture nofree noundef nonnull byval(%struct.MYstr) align 8 dereferenceable(8) [[U:%.*]]) [[ATTR0]] {
173; IS__CGSCC_OPM-NEXT:  entry:
174; IS__CGSCC_OPM-NEXT:    [[Z:%.*]] = getelementptr [[STRUCT_MYSTR:%.*]], %struct.MYstr* [[U]], i32 0, i32 1
175; IS__CGSCC_OPM-NEXT:    store i32 99, i32* [[Z]], align 4
176; IS__CGSCC_OPM-NEXT:    [[TMP0:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U]], i32 0, i32 1
177; IS__CGSCC_OPM-NEXT:    [[TMP1:%.*]] = load i32, i32* [[TMP0]], align 4
178; IS__CGSCC_OPM-NEXT:    [[TMP2:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U]], i32 0, i32 0
179; IS__CGSCC_OPM-NEXT:    [[TMP3:%.*]] = load i8, i8* [[TMP2]], align 8
180; IS__CGSCC_OPM-NEXT:    [[TMP4:%.*]] = zext i8 [[TMP3]] to i32
181; IS__CGSCC_OPM-NEXT:    [[TMP5:%.*]] = add i32 [[TMP4]], [[TMP1]]
182; IS__CGSCC_OPM-NEXT:    ret i32 [[TMP5]]
183;
184; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
185; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@vfu2_v2
186; IS__CGSCC_NPM-SAME: (i8 [[TMP0:%.*]], i32 [[TMP1:%.*]]) [[ATTR0]] {
187; IS__CGSCC_NPM-NEXT:  entry:
188; IS__CGSCC_NPM-NEXT:    [[U_PRIV:%.*]] = alloca [[STRUCT_MYSTR:%.*]], align 8
189; IS__CGSCC_NPM-NEXT:    [[U_PRIV_CAST:%.*]] = bitcast %struct.MYstr* [[U_PRIV]] to i8*
190; IS__CGSCC_NPM-NEXT:    store i8 [[TMP0]], i8* [[U_PRIV_CAST]], align 8
191; IS__CGSCC_NPM-NEXT:    [[U_PRIV_0_1:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 1
192; IS__CGSCC_NPM-NEXT:    store i32 [[TMP1]], i32* [[U_PRIV_0_1]], align 4
193; IS__CGSCC_NPM-NEXT:    [[Z:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 1
194; IS__CGSCC_NPM-NEXT:    store i32 99, i32* [[Z]], align 4
195; IS__CGSCC_NPM-NEXT:    [[TMP2:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 1
196; IS__CGSCC_NPM-NEXT:    [[TMP3:%.*]] = load i32, i32* [[TMP2]], align 4
197; IS__CGSCC_NPM-NEXT:    [[TMP4:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 0
198; IS__CGSCC_NPM-NEXT:    [[TMP5:%.*]] = load i8, i8* [[TMP4]], align 8
199; IS__CGSCC_NPM-NEXT:    [[TMP6:%.*]] = zext i8 [[TMP5]] to i32
200; IS__CGSCC_NPM-NEXT:    [[TMP7:%.*]] = add i32 [[TMP6]], [[TMP3]]
201; IS__CGSCC_NPM-NEXT:    ret i32 [[TMP7]]
202;
203entry:
204  %z = getelementptr %struct.MYstr, %struct.MYstr* %u, i32 0, i32 1
205  store i32 99, i32* %z, align 4
206  %0 = getelementptr %struct.MYstr, %struct.MYstr* %u, i32 0, i32 1 ; <i32*> [#uses=1]
207  %1 = load i32, i32* %0
208  %2 = getelementptr %struct.MYstr, %struct.MYstr* %u, i32 0, i32 0 ; <i8*> [#uses=1]
209  %3 = load i8, i8* %2
210  %4 = zext i8 %3 to i32
211  %5 = add i32 %4, %1
212  ret i32 %5
213}
214
215define i32 @unions_v2() nounwind {
216; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn
217; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@unions_v2
218; IS__TUNIT_OPM-SAME: () [[ATTR2]] {
219; IS__TUNIT_OPM-NEXT:  entry:
220; IS__TUNIT_OPM-NEXT:    [[RESULT:%.*]] = call i32 @vfu2_v2(%struct.MYstr* nocapture nofree noundef nonnull readonly byval(%struct.MYstr) align 8 dereferenceable(8) @mystr) [[ATTR2]]
221; IS__TUNIT_OPM-NEXT:    ret i32 [[RESULT]]
222;
223; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn
224; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@unions_v2
225; IS__TUNIT_NPM-SAME: () [[ATTR2]] {
226; IS__TUNIT_NPM-NEXT:  entry:
227; IS__TUNIT_NPM-NEXT:    [[MYSTR_CAST:%.*]] = bitcast %struct.MYstr* @mystr to i8*
228; IS__TUNIT_NPM-NEXT:    [[TMP0:%.*]] = load i8, i8* [[MYSTR_CAST]], align 8
229; IS__TUNIT_NPM-NEXT:    [[MYSTR_0_1:%.*]] = getelementptr [[STRUCT_MYSTR:%.*]], %struct.MYstr* @mystr, i32 0, i32 1
230; IS__TUNIT_NPM-NEXT:    [[TMP1:%.*]] = load i32, i32* [[MYSTR_0_1]], align 8
231; IS__TUNIT_NPM-NEXT:    [[RESULT:%.*]] = call i32 @vfu2_v2(i8 [[TMP0]], i32 [[TMP1]]) [[ATTR2]]
232; IS__TUNIT_NPM-NEXT:    ret i32 [[RESULT]]
233;
234; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
235; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@unions_v2
236; IS__CGSCC_OPM-SAME: () [[ATTR0]] {
237; IS__CGSCC_OPM-NEXT:  entry:
238; IS__CGSCC_OPM-NEXT:    [[RESULT:%.*]] = call i32 @vfu2_v2(%struct.MYstr* noalias nocapture nofree noundef nonnull readnone byval(%struct.MYstr) align 8 dereferenceable(8) @mystr) [[ATTR3:#.*]]
239; IS__CGSCC_OPM-NEXT:    ret i32 [[RESULT]]
240;
241; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readonly willreturn
242; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@unions_v2
243; IS__CGSCC_NPM-SAME: () [[ATTR1:#.*]] {
244; IS__CGSCC_NPM-NEXT:  entry:
245; IS__CGSCC_NPM-NEXT:    [[MYSTR_CAST1:%.*]] = bitcast %struct.MYstr* @mystr to i8*
246; IS__CGSCC_NPM-NEXT:    [[TMP0:%.*]] = load i8, i8* [[MYSTR_CAST1]], align 8
247; IS__CGSCC_NPM-NEXT:    [[MYSTR_0_12:%.*]] = getelementptr [[STRUCT_MYSTR:%.*]], %struct.MYstr* @mystr, i32 0, i32 1
248; IS__CGSCC_NPM-NEXT:    [[TMP1:%.*]] = load i32, i32* [[MYSTR_0_12]], align 8
249; IS__CGSCC_NPM-NEXT:    [[RESULT:%.*]] = call i32 @vfu2_v2(i8 [[TMP0]], i32 [[TMP1]]) [[ATTR3:#.*]]
250; IS__CGSCC_NPM-NEXT:    ret i32 [[RESULT]]
251;
252entry:
253  call void @vfu1(%struct.MYstr* byval(%struct.MYstr) align 4 @mystr) nounwind
254  %result = call i32 @vfu2_v2(%struct.MYstr* byval(%struct.MYstr) align 4 @mystr) nounwind
255  ret i32 %result
256}
257