1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals
2; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal  -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=2 -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=2 -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
7target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
8
9%struct.ident_t = type { i32, i32, i32, i32, i8* }
10
11@0 = private unnamed_addr constant [23 x i8] c";unknown;unknown;0;0;;\00", align 1
12@1 = private unnamed_addr constant %struct.ident_t { i32 0, i32 514, i32 0, i32 0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @0, i32 0, i32 0) }, align 8
13@2 = private unnamed_addr constant %struct.ident_t { i32 0, i32 2, i32 0, i32 0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @0, i32 0, i32 0) }, align 8
14
15; %a is write only, %b is read only, neither is captured or freed, or ...
16; FIXME: %a and %b are *not* readnone!
17
18;.
19; CHECK: @[[GLOB0:[0-9]+]] = private unnamed_addr constant [23 x i8] c"
20; CHECK: @[[GLOB1:[0-9]+]] = private unnamed_addr constant [[STRUCT_IDENT_T:%.*]] { i32 0, i32 514, i32 0, i32 0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @[[GLOB0]], i32 0, i32 0) }, align 8
21; CHECK: @[[GLOB2:[0-9]+]] = private unnamed_addr constant [[STRUCT_IDENT_T:%.*]] { i32 0, i32 2, i32 0, i32 0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @[[GLOB0]], i32 0, i32 0) }, align 8
22;.
23define dso_local void @func(float* nocapture %a, float* %b, i32 %N) local_unnamed_addr #0 {
24; IS__TUNIT_OPM: Function Attrs: nounwind uwtable
25; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@func
26; IS__TUNIT_OPM-SAME: (float* nocapture nofree writeonly [[A:%.*]], float* nocapture nofree readonly [[B:%.*]], i32 [[N:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] {
27; IS__TUNIT_OPM-NEXT:  entry:
28; IS__TUNIT_OPM-NEXT:    [[A_ADDR:%.*]] = alloca float*, align 8
29; IS__TUNIT_OPM-NEXT:    [[B_ADDR:%.*]] = alloca float*, align 8
30; IS__TUNIT_OPM-NEXT:    [[N_ADDR:%.*]] = alloca i32, align 4
31; IS__TUNIT_OPM-NEXT:    store float* [[A]], float** [[A_ADDR]], align 8
32; IS__TUNIT_OPM-NEXT:    store float* [[B]], float** [[B_ADDR]], align 8
33; IS__TUNIT_OPM-NEXT:    call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* noundef nonnull align 8 dereferenceable(24) @[[GLOB2]], i32 noundef 3, void (i32*, i32*, ...)* noundef bitcast (void (i32*, i32*, i32*, float**, float**)* @.omp_outlined. to void (i32*, i32*, ...)*), i32* noalias nocapture nofree nonnull readnone align 4 dereferenceable(4) undef, float** nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[A_ADDR]], float** nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[B_ADDR]])
34; IS__TUNIT_OPM-NEXT:    ret void
35;
36; IS__TUNIT_NPM: Function Attrs: nounwind uwtable
37; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@func
38; IS__TUNIT_NPM-SAME: (float* nocapture nofree writeonly [[A:%.*]], float* nocapture nofree readonly [[B:%.*]], i32 [[N:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] {
39; IS__TUNIT_NPM-NEXT:  entry:
40; IS__TUNIT_NPM-NEXT:    [[A_ADDR:%.*]] = alloca float*, align 8
41; IS__TUNIT_NPM-NEXT:    [[B_ADDR:%.*]] = alloca float*, align 8
42; IS__TUNIT_NPM-NEXT:    [[N_ADDR:%.*]] = alloca i32, align 4
43; IS__TUNIT_NPM-NEXT:    store float* [[A]], float** [[A_ADDR]], align 8
44; IS__TUNIT_NPM-NEXT:    store float* [[B]], float** [[B_ADDR]], align 8
45; IS__TUNIT_NPM-NEXT:    call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* noundef nonnull align 8 dereferenceable(24) @[[GLOB2]], i32 noundef 3, void (i32*, i32*, ...)* noundef bitcast (void (i32*, i32*, i32*, float**, float**)* @.omp_outlined. to void (i32*, i32*, ...)*), i32* noalias nocapture nofree nonnull readnone align 4 dereferenceable(4) undef, float** noalias nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[A_ADDR]], float** noalias nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[B_ADDR]])
46; IS__TUNIT_NPM-NEXT:    ret void
47;
48; IS__CGSCC_OPM: Function Attrs: nounwind uwtable
49; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@func
50; IS__CGSCC_OPM-SAME: (float* nocapture nofree [[A:%.*]], float* nofree [[B:%.*]], i32 [[N:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] {
51; IS__CGSCC_OPM-NEXT:  entry:
52; IS__CGSCC_OPM-NEXT:    [[A_ADDR:%.*]] = alloca float*, align 8
53; IS__CGSCC_OPM-NEXT:    [[B_ADDR:%.*]] = alloca float*, align 8
54; IS__CGSCC_OPM-NEXT:    [[N_ADDR:%.*]] = alloca i32, align 4
55; IS__CGSCC_OPM-NEXT:    store float* [[A]], float** [[A_ADDR]], align 8
56; IS__CGSCC_OPM-NEXT:    store float* [[B]], float** [[B_ADDR]], align 8
57; IS__CGSCC_OPM-NEXT:    store i32 199, i32* [[N_ADDR]], align 4
58; IS__CGSCC_OPM-NEXT:    call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* noundef nonnull align 8 dereferenceable(24) @[[GLOB2]], i32 noundef 3, void (i32*, i32*, ...)* noundef bitcast (void (i32*, i32*, i32*, float**, float**)* @.omp_outlined. to void (i32*, i32*, ...)*), i32* noalias nocapture nofree noundef nonnull readnone align 4 dereferenceable(4) [[N_ADDR]], float** nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[A_ADDR]], float** nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[B_ADDR]])
59; IS__CGSCC_OPM-NEXT:    ret void
60;
61; IS__CGSCC_NPM: Function Attrs: nounwind uwtable
62; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@func
63; IS__CGSCC_NPM-SAME: (float* nocapture nofree [[A:%.*]], float* nofree [[B:%.*]], i32 [[N:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] {
64; IS__CGSCC_NPM-NEXT:  entry:
65; IS__CGSCC_NPM-NEXT:    [[A_ADDR:%.*]] = alloca float*, align 8
66; IS__CGSCC_NPM-NEXT:    [[B_ADDR:%.*]] = alloca float*, align 8
67; IS__CGSCC_NPM-NEXT:    [[N_ADDR:%.*]] = alloca i32, align 4
68; IS__CGSCC_NPM-NEXT:    store float* [[A]], float** [[A_ADDR]], align 8
69; IS__CGSCC_NPM-NEXT:    store float* [[B]], float** [[B_ADDR]], align 8
70; IS__CGSCC_NPM-NEXT:    store i32 199, i32* [[N_ADDR]], align 4
71; IS__CGSCC_NPM-NEXT:    call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* noundef nonnull align 8 dereferenceable(24) @[[GLOB2]], i32 noundef 3, void (i32*, i32*, ...)* noundef bitcast (void (i32*, i32*, i32*, float**, float**)* @.omp_outlined. to void (i32*, i32*, ...)*), i32* noalias nocapture nofree noundef nonnull readnone align 4 dereferenceable(4) [[N_ADDR]], float** noalias nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[A_ADDR]], float** noalias nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[B_ADDR]])
72; IS__CGSCC_NPM-NEXT:    ret void
73;
74entry:
75  %a.addr = alloca float*, align 8
76  %b.addr = alloca float*, align 8
77  %N.addr = alloca i32, align 4
78  store float* %a, float** %a.addr, align 8
79  store float* %b, float** %b.addr, align 8
80  store i32 199, i32* %N.addr, align 4
81  call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* nonnull @2, i32 3, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i32*, float**, float**)* @.omp_outlined. to void (i32*, i32*, ...)*), i32* nonnull %N.addr, float** nonnull %a.addr, float** nonnull %b.addr)
82  ret void
83}
84
85; FIXME: %N should not be loaded but 199 should be used.
86
87define internal void @.omp_outlined.(i32* noalias nocapture readonly %.global_tid., i32* noalias nocapture readnone %.bound_tid., i32* nocapture nonnull readonly align 4 dereferenceable(4) %N, float** nocapture nonnull readonly align 8 dereferenceable(8) %a, float** nocapture nonnull readonly align 8 dereferenceable(8) %b) #1 {
88; IS________OPM: Function Attrs: alwaysinline nofree norecurse nounwind uwtable
89; IS________OPM-LABEL: define {{[^@]+}}@.omp_outlined.
90; IS________OPM-SAME: (i32* noalias nocapture nofree readonly [[DOTGLOBAL_TID_:%.*]], i32* noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], i32* noalias nocapture nofree nonnull readnone align 4 dereferenceable(4) [[N:%.*]], float** nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[A:%.*]], float** nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[B:%.*]]) #[[ATTR1:[0-9]+]] {
91; IS________OPM-NEXT:  entry:
92; IS________OPM-NEXT:    [[DOTOMP_LB:%.*]] = alloca i32, align 4
93; IS________OPM-NEXT:    [[DOTOMP_UB:%.*]] = alloca i32, align 4
94; IS________OPM-NEXT:    [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
95; IS________OPM-NEXT:    [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
96; IS________OPM-NEXT:    br label [[OMP_PRECOND_THEN:%.*]]
97; IS________OPM:       omp.precond.then:
98; IS________OPM-NEXT:    [[TMP0:%.*]] = bitcast i32* [[DOTOMP_LB]] to i8*
99; IS________OPM-NEXT:    call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[TMP0]])
100; IS________OPM-NEXT:    store i32 0, i32* [[DOTOMP_LB]], align 4
101; IS________OPM-NEXT:    [[TMP1:%.*]] = bitcast i32* [[DOTOMP_UB]] to i8*
102; IS________OPM-NEXT:    call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[TMP1]])
103; IS________OPM-NEXT:    store i32 197, i32* [[DOTOMP_UB]], align 4
104; IS________OPM-NEXT:    [[TMP2:%.*]] = bitcast i32* [[DOTOMP_STRIDE]] to i8*
105; IS________OPM-NEXT:    call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[TMP2]])
106; IS________OPM-NEXT:    store i32 1, i32* [[DOTOMP_STRIDE]], align 4
107; IS________OPM-NEXT:    [[TMP3:%.*]] = bitcast i32* [[DOTOMP_IS_LAST]] to i8*
108; IS________OPM-NEXT:    call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[TMP3]])
109; IS________OPM-NEXT:    store i32 0, i32* [[DOTOMP_IS_LAST]], align 4
110; IS________OPM-NEXT:    [[TMP4:%.*]] = load i32, i32* [[DOTGLOBAL_TID_]], align 4
111; IS________OPM-NEXT:    call void @__kmpc_for_static_init_4(%struct.ident_t* noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 [[TMP4]], i32 noundef 34, i32* noundef nonnull align 4 dereferenceable(4) [[DOTOMP_IS_LAST]], i32* noundef nonnull align 4 dereferenceable(4) [[DOTOMP_LB]], i32* noundef nonnull align 4 dereferenceable(4) [[DOTOMP_UB]], i32* noundef nonnull align 4 dereferenceable(4) [[DOTOMP_STRIDE]], i32 noundef 1, i32 noundef 1)
112; IS________OPM-NEXT:    [[TMP5:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
113; IS________OPM-NEXT:    [[CMP4:%.*]] = icmp sgt i32 [[TMP5]], 197
114; IS________OPM-NEXT:    [[COND:%.*]] = select i1 [[CMP4]], i32 197, i32 [[TMP5]]
115; IS________OPM-NEXT:    store i32 [[COND]], i32* [[DOTOMP_UB]], align 4
116; IS________OPM-NEXT:    [[TMP6:%.*]] = load i32, i32* [[DOTOMP_LB]], align 4
117; IS________OPM-NEXT:    [[CMP513:%.*]] = icmp sgt i32 [[TMP6]], [[COND]]
118; IS________OPM-NEXT:    br i1 [[CMP513]], label [[OMP_LOOP_EXIT:%.*]], label [[OMP_INNER_FOR_BODY_LR_PH:%.*]]
119; IS________OPM:       omp.inner.for.body.lr.ph:
120; IS________OPM-NEXT:    [[TMP7:%.*]] = load float*, float** [[B]], align 8
121; IS________OPM-NEXT:    [[TMP8:%.*]] = load float*, float** [[A]], align 8
122; IS________OPM-NEXT:    [[TMP9:%.*]] = sext i32 [[TMP6]] to i64
123; IS________OPM-NEXT:    [[TMP10:%.*]] = sext i32 [[COND]] to i64
124; IS________OPM-NEXT:    br label [[OMP_INNER_FOR_BODY:%.*]]
125; IS________OPM:       omp.inner.for.body:
126; IS________OPM-NEXT:    [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[OMP_INNER_FOR_BODY]] ], [ [[TMP9]], [[OMP_INNER_FOR_BODY_LR_PH]] ]
127; IS________OPM-NEXT:    [[INDVARS_IV_NEXT]] = add nsw i64 [[INDVARS_IV]], 1
128; IS________OPM-NEXT:    [[ARRAYIDX:%.*]] = getelementptr inbounds float, float* [[TMP7]], i64 [[INDVARS_IV_NEXT]]
129; IS________OPM-NEXT:    [[TMP11:%.*]] = load float, float* [[ARRAYIDX]], align 4
130; IS________OPM-NEXT:    [[CONV7:%.*]] = fadd float [[TMP11]], 1.000000e+00
131; IS________OPM-NEXT:    [[ARRAYIDX9:%.*]] = getelementptr inbounds float, float* [[TMP8]], i64 [[INDVARS_IV_NEXT]]
132; IS________OPM-NEXT:    store float [[CONV7]], float* [[ARRAYIDX9]], align 4
133; IS________OPM-NEXT:    [[CMP5:%.*]] = icmp slt i64 [[INDVARS_IV]], [[TMP10]]
134; IS________OPM-NEXT:    br i1 [[CMP5]], label [[OMP_INNER_FOR_BODY]], label [[OMP_LOOP_EXIT]]
135; IS________OPM:       omp.loop.exit:
136; IS________OPM-NEXT:    call void @__kmpc_for_static_fini(%struct.ident_t* noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 [[TMP4]])
137; IS________OPM-NEXT:    call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[TMP3]])
138; IS________OPM-NEXT:    call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[TMP2]])
139; IS________OPM-NEXT:    call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[TMP1]])
140; IS________OPM-NEXT:    call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[TMP0]])
141; IS________OPM-NEXT:    br label [[OMP_PRECOND_END:%.*]]
142; IS________OPM:       omp.precond.end:
143; IS________OPM-NEXT:    ret void
144;
145; IS________NPM: Function Attrs: alwaysinline nofree norecurse nounwind uwtable
146; IS________NPM-LABEL: define {{[^@]+}}@.omp_outlined.
147; IS________NPM-SAME: (i32* noalias nocapture nofree readonly [[DOTGLOBAL_TID_:%.*]], i32* noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], i32* noalias nocapture nofree nonnull readnone align 4 dereferenceable(4) [[N:%.*]], float** noalias nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[A:%.*]], float** noalias nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[B:%.*]]) #[[ATTR1:[0-9]+]] {
148; IS________NPM-NEXT:  entry:
149; IS________NPM-NEXT:    [[DOTOMP_LB:%.*]] = alloca i32, align 4
150; IS________NPM-NEXT:    [[DOTOMP_UB:%.*]] = alloca i32, align 4
151; IS________NPM-NEXT:    [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
152; IS________NPM-NEXT:    [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
153; IS________NPM-NEXT:    br label [[OMP_PRECOND_THEN:%.*]]
154; IS________NPM:       omp.precond.then:
155; IS________NPM-NEXT:    [[TMP0:%.*]] = bitcast i32* [[DOTOMP_LB]] to i8*
156; IS________NPM-NEXT:    call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[TMP0]])
157; IS________NPM-NEXT:    store i32 0, i32* [[DOTOMP_LB]], align 4
158; IS________NPM-NEXT:    [[TMP1:%.*]] = bitcast i32* [[DOTOMP_UB]] to i8*
159; IS________NPM-NEXT:    call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[TMP1]])
160; IS________NPM-NEXT:    store i32 197, i32* [[DOTOMP_UB]], align 4
161; IS________NPM-NEXT:    [[TMP2:%.*]] = bitcast i32* [[DOTOMP_STRIDE]] to i8*
162; IS________NPM-NEXT:    call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[TMP2]])
163; IS________NPM-NEXT:    store i32 1, i32* [[DOTOMP_STRIDE]], align 4
164; IS________NPM-NEXT:    [[TMP3:%.*]] = bitcast i32* [[DOTOMP_IS_LAST]] to i8*
165; IS________NPM-NEXT:    call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[TMP3]])
166; IS________NPM-NEXT:    store i32 0, i32* [[DOTOMP_IS_LAST]], align 4
167; IS________NPM-NEXT:    [[TMP4:%.*]] = load i32, i32* [[DOTGLOBAL_TID_]], align 4
168; IS________NPM-NEXT:    call void @__kmpc_for_static_init_4(%struct.ident_t* noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 [[TMP4]], i32 noundef 34, i32* noundef nonnull align 4 dereferenceable(4) [[DOTOMP_IS_LAST]], i32* noundef nonnull align 4 dereferenceable(4) [[DOTOMP_LB]], i32* noundef nonnull align 4 dereferenceable(4) [[DOTOMP_UB]], i32* noundef nonnull align 4 dereferenceable(4) [[DOTOMP_STRIDE]], i32 noundef 1, i32 noundef 1)
169; IS________NPM-NEXT:    [[TMP5:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
170; IS________NPM-NEXT:    [[CMP4:%.*]] = icmp sgt i32 [[TMP5]], 197
171; IS________NPM-NEXT:    [[COND:%.*]] = select i1 [[CMP4]], i32 197, i32 [[TMP5]]
172; IS________NPM-NEXT:    store i32 [[COND]], i32* [[DOTOMP_UB]], align 4
173; IS________NPM-NEXT:    [[TMP6:%.*]] = load i32, i32* [[DOTOMP_LB]], align 4
174; IS________NPM-NEXT:    [[CMP513:%.*]] = icmp sgt i32 [[TMP6]], [[COND]]
175; IS________NPM-NEXT:    br i1 [[CMP513]], label [[OMP_LOOP_EXIT:%.*]], label [[OMP_INNER_FOR_BODY_LR_PH:%.*]]
176; IS________NPM:       omp.inner.for.body.lr.ph:
177; IS________NPM-NEXT:    [[TMP7:%.*]] = load float*, float** [[B]], align 8
178; IS________NPM-NEXT:    [[TMP8:%.*]] = load float*, float** [[A]], align 8
179; IS________NPM-NEXT:    [[TMP9:%.*]] = sext i32 [[TMP6]] to i64
180; IS________NPM-NEXT:    [[TMP10:%.*]] = sext i32 [[COND]] to i64
181; IS________NPM-NEXT:    br label [[OMP_INNER_FOR_BODY:%.*]]
182; IS________NPM:       omp.inner.for.body:
183; IS________NPM-NEXT:    [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[OMP_INNER_FOR_BODY]] ], [ [[TMP9]], [[OMP_INNER_FOR_BODY_LR_PH]] ]
184; IS________NPM-NEXT:    [[INDVARS_IV_NEXT]] = add nsw i64 [[INDVARS_IV]], 1
185; IS________NPM-NEXT:    [[ARRAYIDX:%.*]] = getelementptr inbounds float, float* [[TMP7]], i64 [[INDVARS_IV_NEXT]]
186; IS________NPM-NEXT:    [[TMP11:%.*]] = load float, float* [[ARRAYIDX]], align 4
187; IS________NPM-NEXT:    [[CONV7:%.*]] = fadd float [[TMP11]], 1.000000e+00
188; IS________NPM-NEXT:    [[ARRAYIDX9:%.*]] = getelementptr inbounds float, float* [[TMP8]], i64 [[INDVARS_IV_NEXT]]
189; IS________NPM-NEXT:    store float [[CONV7]], float* [[ARRAYIDX9]], align 4
190; IS________NPM-NEXT:    [[CMP5:%.*]] = icmp slt i64 [[INDVARS_IV]], [[TMP10]]
191; IS________NPM-NEXT:    br i1 [[CMP5]], label [[OMP_INNER_FOR_BODY]], label [[OMP_LOOP_EXIT]]
192; IS________NPM:       omp.loop.exit:
193; IS________NPM-NEXT:    call void @__kmpc_for_static_fini(%struct.ident_t* noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 [[TMP4]])
194; IS________NPM-NEXT:    call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[TMP3]])
195; IS________NPM-NEXT:    call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[TMP2]])
196; IS________NPM-NEXT:    call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[TMP1]])
197; IS________NPM-NEXT:    call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[TMP0]])
198; IS________NPM-NEXT:    br label [[OMP_PRECOND_END:%.*]]
199; IS________NPM:       omp.precond.end:
200; IS________NPM-NEXT:    ret void
201;
202entry:
203  %.omp.lb = alloca i32, align 4
204  %.omp.ub = alloca i32, align 4
205  %.omp.stride = alloca i32, align 4
206  %.omp.is_last = alloca i32, align 4
207  %0 = load i32, i32* %N, align 4
208  %sub2 = add nsw i32 %0, -2
209  %cmp = icmp sgt i32 %0, 1
210  br i1 %cmp, label %omp.precond.then, label %omp.precond.end
211
212omp.precond.then:                                 ; preds = %entry
213  %1 = bitcast i32* %.omp.lb to i8*
214  call void @llvm.lifetime.start.p0i8(i64 4, i8* nonnull %1) #3
215  store i32 0, i32* %.omp.lb, align 4
216  %2 = bitcast i32* %.omp.ub to i8*
217  call void @llvm.lifetime.start.p0i8(i64 4, i8* nonnull %2) #3
218  store i32 %sub2, i32* %.omp.ub, align 4
219  %3 = bitcast i32* %.omp.stride to i8*
220  call void @llvm.lifetime.start.p0i8(i64 4, i8* nonnull %3) #3
221  store i32 1, i32* %.omp.stride, align 4
222  %4 = bitcast i32* %.omp.is_last to i8*
223  call void @llvm.lifetime.start.p0i8(i64 4, i8* nonnull %4) #3
224  store i32 0, i32* %.omp.is_last, align 4
225  %5 = load i32, i32* %.global_tid., align 4
226  call void @__kmpc_for_static_init_4(%struct.ident_t* nonnull @1, i32 %5, i32 34, i32* nonnull %.omp.is_last, i32* nonnull %.omp.lb, i32* nonnull %.omp.ub, i32* nonnull %.omp.stride, i32 1, i32 1) #3
227  %6 = load i32, i32* %.omp.ub, align 4
228  %cmp4 = icmp sgt i32 %6, %sub2
229  %cond = select i1 %cmp4, i32 %sub2, i32 %6
230  store i32 %cond, i32* %.omp.ub, align 4
231  %7 = load i32, i32* %.omp.lb, align 4
232  %cmp513 = icmp sgt i32 %7, %cond
233  br i1 %cmp513, label %omp.loop.exit, label %omp.inner.for.body.lr.ph
234
235omp.inner.for.body.lr.ph:                         ; preds = %omp.precond.then
236  %8 = load float*, float** %b, align 8
237  %9 = load float*, float** %a, align 8
238  %10 = sext i32 %7 to i64
239  %11 = sext i32 %cond to i64
240  br label %omp.inner.for.body
241
242omp.inner.for.body:                               ; preds = %omp.inner.for.body, %omp.inner.for.body.lr.ph
243  %indvars.iv = phi i64 [ %indvars.iv.next, %omp.inner.for.body ], [ %10, %omp.inner.for.body.lr.ph ]
244  %indvars.iv.next = add nsw i64 %indvars.iv, 1
245  %arrayidx = getelementptr inbounds float, float* %8, i64 %indvars.iv.next
246  %12 = load float, float* %arrayidx, align 4
247  %conv7 = fadd float %12, 1.000000e+00
248  %arrayidx9 = getelementptr inbounds float, float* %9, i64 %indvars.iv.next
249  store float %conv7, float* %arrayidx9, align 4
250  %cmp5 = icmp slt i64 %indvars.iv, %11
251  br i1 %cmp5, label %omp.inner.for.body, label %omp.loop.exit
252
253omp.loop.exit:                                    ; preds = %omp.inner.for.body, %omp.precond.then
254  call void @__kmpc_for_static_fini(%struct.ident_t* nonnull @1, i32 %5)
255  call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull %4) #3
256  call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull %3) #3
257  call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull %2) #3
258  call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull %1) #3
259  br label %omp.precond.end
260
261omp.precond.end:                                  ; preds = %omp.loop.exit, %entry
262  ret void
263}
264
265; Function Attrs: argmemonly nounwind willreturn
266declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture) #2
267
268; Function Attrs: argmemonly nounwind willreturn
269declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture) #2
270
271declare dso_local void @__kmpc_for_static_init_4(%struct.ident_t*, i32, i32, i32*, i32*, i32*, i32*, i32, i32) local_unnamed_addr
272
273; Function Attrs: nounwind
274declare void @__kmpc_for_static_fini(%struct.ident_t*, i32) local_unnamed_addr #3
275
276; Function Attrs: nounwind
277declare !callback !1 void @__kmpc_fork_call(%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) local_unnamed_addr #3
278
279attributes #0 = { nounwind uwtable }
280attributes #1 = { alwaysinline nofree norecurse nounwind uwtable }
281attributes #2 = { nounwind }
282
283!llvm.module.flags = !{!0}
284
285!0 = !{i32 7, !"openmp", i32 50}
286!1 = !{!2}
287!2 = !{i64 2, i64 -1, i64 -1, i1 true}
288;.
289; CHECK: attributes #[[ATTR0:[0-9]+]] = { nounwind uwtable }
290; CHECK: attributes #[[ATTR1:[0-9]+]] = { alwaysinline nofree norecurse nounwind uwtable }
291; CHECK: attributes #[[ATTR2:[0-9]+]] = { argmemonly nofree nosync nounwind willreturn }
292;.
293; CHECK: [[META0:![0-9]+]] = !{i32 7, !"openmp", i32 50}
294; CHECK: [[META1:![0-9]+]] = !{!2}
295; CHECK: [[META2:![0-9]+]] = !{i64 2, i64 -1, i64 -1, i1 true}
296;.
297