1f90abac6SMike Rice // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --function-signature --include-generated-funcs
2*532dc62bSNikita Popov //  RUN: %clang_cc1 -no-opaque-pointers -no-enable-noundef-analysis -triple x86_64-unknown-linux-gnu -fopenmp -DNORM \
3f90abac6SMike Rice //RUN:  -emit-llvm -o - %s | FileCheck %s --check-prefix NORM
4f90abac6SMike Rice 
5*532dc62bSNikita Popov //RUN: %clang_cc1 -no-opaque-pointers -no-enable-noundef-analysis -triple x86_64-unknown-linux-gnu -fopenmp -DCOMP \
6f90abac6SMike Rice //RUN:  -emit-llvm -o - %s | FileCheck %s --check-prefix COMP
7f90abac6SMike Rice 
8f90abac6SMike Rice // Prefer compound operators since that is what the spec seems to say.
9*532dc62bSNikita Popov //  RUN: %clang_cc1 -no-opaque-pointers -no-enable-noundef-analysis -triple x86_64-unknown-linux-gnu -fopenmp -DNORM -DCOMP \
10ac90dfc4SGiorgis Georgakoudis //RUN:  -emit-llvm -o - %s | FileCheck %s --check-prefix COMP
11f90abac6SMike Rice 
12*532dc62bSNikita Popov //RUN: %clang_cc1 -no-opaque-pointers -no-enable-noundef-analysis -triple x86_64-unknown-linux-gnu -fopenmp-simd -DNORM \
13ac90dfc4SGiorgis Georgakoudis //RUN:  -emit-llvm -o - %s | FileCheck %s --check-prefix SIMD-ONLY
14f90abac6SMike Rice 
15*532dc62bSNikita Popov //RUN: %clang_cc1 -no-opaque-pointers -no-enable-noundef-analysis -triple x86_64-unknown-linux-gnu -fopenmp-simd -DCOMP \
16ac90dfc4SGiorgis Georgakoudis //RUN:  -emit-llvm -o - %s | FileCheck %s --check-prefix SIMD-ONLY
17f90abac6SMike Rice 
18*532dc62bSNikita Popov //RUN: %clang_cc1 -no-opaque-pointers -no-enable-noundef-analysis -triple x86_64-unknown-linux-gnu -fopenmp-simd -DNORM -DCOMP \
19ac90dfc4SGiorgis Georgakoudis //RUN:  -emit-llvm -o - %s | FileCheck %s --check-prefix SIMD-ONLY
20ac90dfc4SGiorgis Georgakoudis 
21ac90dfc4SGiorgis Georgakoudis // SIMD-ONLY-NOT: {{__kmpc|__tgt}}
22f90abac6SMike Rice 
23f90abac6SMike Rice struct Point {
24f90abac6SMike Rice   int x = 0;
25f90abac6SMike Rice   int y = 0;
26f90abac6SMike Rice #if NORM
27f90abac6SMike Rice   Point operator+(Point const &other) const;
28f90abac6SMike Rice   Point operator-(Point const &other) const;
29f90abac6SMike Rice   Point operator*(Point const &other) const;
30f90abac6SMike Rice   Point operator&(Point const &other) const;
31f90abac6SMike Rice   Point operator|(Point const &other) const;
32f90abac6SMike Rice   Point operator^(Point const &other) const;
33f90abac6SMike Rice #endif
34f90abac6SMike Rice   Point operator&&(Point const &other) const;
35f90abac6SMike Rice   Point operator||(Point const &other) const;
36f90abac6SMike Rice   Point &operator=(Point const &other);
37f90abac6SMike Rice #if COMP
38f90abac6SMike Rice   Point &operator+=(Point const &other);
39f90abac6SMike Rice   Point &operator*=(Point const &other);
40f90abac6SMike Rice   Point &operator&=(Point const &other);
41f90abac6SMike Rice   Point &operator|=(Point const &other);
42f90abac6SMike Rice   Point &operator^=(Point const &other);
43f90abac6SMike Rice #endif
44f90abac6SMike Rice };
45f90abac6SMike Rice 
46f90abac6SMike Rice void work(Point &P, int N, Point const *Points);
47f90abac6SMike Rice 
foo(int N,Point const * Points)48f90abac6SMike Rice void foo(int N, Point const *Points) {
49f90abac6SMike Rice   Point Red;
50f90abac6SMike Rice   #pragma omp parallel for reduction(+: Red)
51f90abac6SMike Rice   for (unsigned I = 0; I < N; ++I)
52f90abac6SMike Rice     work(Red, I, Points);
53f90abac6SMike Rice 
54f90abac6SMike Rice   #pragma omp parallel for reduction(-: Red)
55f90abac6SMike Rice   for (unsigned I = 0; I < N; ++I)
56f90abac6SMike Rice     work(Red, I, Points);
57f90abac6SMike Rice 
58f90abac6SMike Rice   #pragma omp parallel for reduction(*: Red)
59f90abac6SMike Rice   for (unsigned I = 0; I < N; ++I)
60f90abac6SMike Rice     work(Red, I, Points);
61f90abac6SMike Rice 
62f90abac6SMike Rice   #pragma omp parallel for reduction(&: Red)
63f90abac6SMike Rice   for (unsigned I = 0; I < N; ++I)
64f90abac6SMike Rice     work(Red, I, Points);
65f90abac6SMike Rice 
66f90abac6SMike Rice   #pragma omp parallel for reduction(|: Red)
67f90abac6SMike Rice   for (unsigned I = 0; I < N; ++I)
68f90abac6SMike Rice     work(Red, I, Points);
69f90abac6SMike Rice 
70f90abac6SMike Rice   #pragma omp parallel for reduction(^: Red)
71f90abac6SMike Rice   for (unsigned I = 0; I < N; ++I)
72f90abac6SMike Rice     work(Red, I, Points);
73f90abac6SMike Rice 
74f90abac6SMike Rice   #pragma omp parallel for reduction(&&: Red)
75f90abac6SMike Rice   for (unsigned I = 0; I < N; ++I)
76f90abac6SMike Rice     work(Red, I, Points);
77f90abac6SMike Rice 
78f90abac6SMike Rice   #pragma omp parallel for reduction(||: Red)
79f90abac6SMike Rice   for (unsigned I = 0; I < N; ++I)
80f90abac6SMike Rice     work(Red, I, Points);
81f90abac6SMike Rice }
82f90abac6SMike Rice // NORM-LABEL: define {{[^@]+}}@_Z3fooiPK5Point
83f90abac6SMike Rice // NORM-SAME: (i32 [[N:%.*]], %struct.Point* [[POINTS:%.*]]) #[[ATTR0:[0-9]+]] {
84f90abac6SMike Rice // NORM-NEXT:  entry:
85f90abac6SMike Rice // NORM-NEXT:    [[N_ADDR:%.*]] = alloca i32, align 4
86f90abac6SMike Rice // NORM-NEXT:    [[POINTS_ADDR:%.*]] = alloca %struct.Point*, align 8
87f90abac6SMike Rice // NORM-NEXT:    [[RED:%.*]] = alloca [[STRUCT_POINT:%.*]], align 4
88f90abac6SMike Rice // NORM-NEXT:    store i32 [[N]], i32* [[N_ADDR]], align 4
89f90abac6SMike Rice // NORM-NEXT:    store %struct.Point* [[POINTS]], %struct.Point** [[POINTS_ADDR]], align 8
9016d03818SRoman Lebedev // NORM-NEXT:    call void @_ZN5PointC1Ev(%struct.Point* nonnull align 4 dereferenceable(8) [[RED]]) #[[ATTR4:[0-9]+]]
91ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB3:[0-9]+]], i32 3, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i32*, %struct.Point*, %struct.Point**)* @.omp_outlined. to void (i32*, i32*, ...)*), i32* [[N_ADDR]], %struct.Point* [[RED]], %struct.Point** [[POINTS_ADDR]])
92ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB3]], i32 3, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i32*, %struct.Point*, %struct.Point**)* @.omp_outlined..1 to void (i32*, i32*, ...)*), i32* [[N_ADDR]], %struct.Point* [[RED]], %struct.Point** [[POINTS_ADDR]])
93ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB3]], i32 3, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i32*, %struct.Point*, %struct.Point**)* @.omp_outlined..3 to void (i32*, i32*, ...)*), i32* [[N_ADDR]], %struct.Point* [[RED]], %struct.Point** [[POINTS_ADDR]])
94ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB3]], i32 3, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i32*, %struct.Point*, %struct.Point**)* @.omp_outlined..5 to void (i32*, i32*, ...)*), i32* [[N_ADDR]], %struct.Point* [[RED]], %struct.Point** [[POINTS_ADDR]])
95ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB3]], i32 3, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i32*, %struct.Point*, %struct.Point**)* @.omp_outlined..7 to void (i32*, i32*, ...)*), i32* [[N_ADDR]], %struct.Point* [[RED]], %struct.Point** [[POINTS_ADDR]])
96ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB3]], i32 3, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i32*, %struct.Point*, %struct.Point**)* @.omp_outlined..9 to void (i32*, i32*, ...)*), i32* [[N_ADDR]], %struct.Point* [[RED]], %struct.Point** [[POINTS_ADDR]])
97ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB3]], i32 3, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i32*, %struct.Point*, %struct.Point**)* @.omp_outlined..11 to void (i32*, i32*, ...)*), i32* [[N_ADDR]], %struct.Point* [[RED]], %struct.Point** [[POINTS_ADDR]])
98ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB3]], i32 3, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i32*, %struct.Point*, %struct.Point**)* @.omp_outlined..13 to void (i32*, i32*, ...)*), i32* [[N_ADDR]], %struct.Point* [[RED]], %struct.Point** [[POINTS_ADDR]])
99f90abac6SMike Rice // NORM-NEXT:    ret void
100f90abac6SMike Rice //
101f90abac6SMike Rice //
102f90abac6SMike Rice // NORM-LABEL: define {{[^@]+}}@_ZN5PointC1Ev
10316d03818SRoman Lebedev // NORM-SAME: (%struct.Point* nonnull align 4 dereferenceable(8) [[THIS:%.*]]) unnamed_addr #[[ATTR1:[0-9]+]] comdat align 2 {
104f90abac6SMike Rice // NORM-NEXT:  entry:
105f90abac6SMike Rice // NORM-NEXT:    [[THIS_ADDR:%.*]] = alloca %struct.Point*, align 8
106f90abac6SMike Rice // NORM-NEXT:    store %struct.Point* [[THIS]], %struct.Point** [[THIS_ADDR]], align 8
107f90abac6SMike Rice // NORM-NEXT:    [[THIS1:%.*]] = load %struct.Point*, %struct.Point** [[THIS_ADDR]], align 8
10816d03818SRoman Lebedev // NORM-NEXT:    call void @_ZN5PointC2Ev(%struct.Point* nonnull align 4 dereferenceable(8) [[THIS1]]) #[[ATTR4]]
109f90abac6SMike Rice // NORM-NEXT:    ret void
110f90abac6SMike Rice //
111f90abac6SMike Rice //
112f90abac6SMike Rice // NORM-LABEL: define {{[^@]+}}@.omp_outlined.
113ac90dfc4SGiorgis Georgakoudis // NORM-SAME: (i32* noalias [[DOTGLOBAL_TID_:%.*]], i32* noalias [[DOTBOUND_TID_:%.*]], i32* nonnull align 4 dereferenceable(4) [[N:%.*]], %struct.Point* nonnull align 4 dereferenceable(8) [[RED:%.*]], %struct.Point** nonnull align 8 dereferenceable(8) [[POINTS:%.*]]) #[[ATTR2:[0-9]+]] {
114f90abac6SMike Rice // NORM-NEXT:  entry:
115f90abac6SMike Rice // NORM-NEXT:    [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
116f90abac6SMike Rice // NORM-NEXT:    [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
117ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[N_ADDR:%.*]] = alloca i32*, align 8
118ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[RED_ADDR:%.*]] = alloca %struct.Point*, align 8
119ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[POINTS_ADDR:%.*]] = alloca %struct.Point**, align 8
120f90abac6SMike Rice // NORM-NEXT:    [[DOTOMP_IV:%.*]] = alloca i32, align 4
121f90abac6SMike Rice // NORM-NEXT:    [[TMP:%.*]] = alloca i32, align 4
122f90abac6SMike Rice // NORM-NEXT:    [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
123f90abac6SMike Rice // NORM-NEXT:    [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
124f90abac6SMike Rice // NORM-NEXT:    [[I:%.*]] = alloca i32, align 4
125f90abac6SMike Rice // NORM-NEXT:    [[DOTOMP_LB:%.*]] = alloca i32, align 4
126f90abac6SMike Rice // NORM-NEXT:    [[DOTOMP_UB:%.*]] = alloca i32, align 4
127f90abac6SMike Rice // NORM-NEXT:    [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
128f90abac6SMike Rice // NORM-NEXT:    [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
129ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[RED3:%.*]] = alloca [[STRUCT_POINT:%.*]], align 4
130ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[I4:%.*]] = alloca i32, align 4
131f90abac6SMike Rice // NORM-NEXT:    [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [1 x i8*], align 8
132f90abac6SMike Rice // NORM-NEXT:    [[REF_TMP:%.*]] = alloca [[STRUCT_POINT]], align 4
133ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[REF_TMP10:%.*]] = alloca [[STRUCT_POINT]], align 4
134f90abac6SMike Rice // NORM-NEXT:    store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
135f90abac6SMike Rice // NORM-NEXT:    store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
136ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i32* [[N]], i32** [[N_ADDR]], align 8
137ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store %struct.Point* [[RED]], %struct.Point** [[RED_ADDR]], align 8
138ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store %struct.Point** [[POINTS]], %struct.Point*** [[POINTS_ADDR]], align 8
139ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP0:%.*]] = load i32*, i32** [[N_ADDR]], align 8
140ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP1:%.*]] = load %struct.Point*, %struct.Point** [[RED_ADDR]], align 8
141ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP2:%.*]] = load %struct.Point**, %struct.Point*** [[POINTS_ADDR]], align 8
142ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP3:%.*]] = load i32, i32* [[TMP0]], align 4
143ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i32 [[TMP3]], i32* [[DOTCAPTURE_EXPR_]], align 4
144ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP4:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_]], align 4
145ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[SUB:%.*]] = sub i32 [[TMP4]], 0
146f90abac6SMike Rice // NORM-NEXT:    [[DIV:%.*]] = udiv i32 [[SUB]], 1
147f90abac6SMike Rice // NORM-NEXT:    [[SUB2:%.*]] = sub i32 [[DIV]], 1
148f90abac6SMike Rice // NORM-NEXT:    store i32 [[SUB2]], i32* [[DOTCAPTURE_EXPR_1]], align 4
149f90abac6SMike Rice // NORM-NEXT:    store i32 0, i32* [[I]], align 4
150ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP5:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_]], align 4
151ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[CMP:%.*]] = icmp ult i32 0, [[TMP5]]
152f90abac6SMike Rice // NORM-NEXT:    br i1 [[CMP]], label [[OMP_PRECOND_THEN:%.*]], label [[OMP_PRECOND_END:%.*]]
153f90abac6SMike Rice // NORM:       omp.precond.then:
154f90abac6SMike Rice // NORM-NEXT:    store i32 0, i32* [[DOTOMP_LB]], align 4
155ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP6:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_1]], align 4
156ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i32 [[TMP6]], i32* [[DOTOMP_UB]], align 4
157f90abac6SMike Rice // NORM-NEXT:    store i32 1, i32* [[DOTOMP_STRIDE]], align 4
158f90abac6SMike Rice // NORM-NEXT:    store i32 0, i32* [[DOTOMP_IS_LAST]], align 4
159ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    call void @_ZN5PointC1Ev(%struct.Point* nonnull align 4 dereferenceable(8) [[RED3]]) #[[ATTR4]]
160ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP7:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
161ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP8:%.*]] = load i32, i32* [[TMP7]], align 4
162ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    call void @__kmpc_for_static_init_4u(%struct.ident_t* @[[GLOB1:[0-9]+]], i32 [[TMP8]], i32 34, i32* [[DOTOMP_IS_LAST]], i32* [[DOTOMP_LB]], i32* [[DOTOMP_UB]], i32* [[DOTOMP_STRIDE]], i32 1, i32 1)
163ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP9:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
164ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP10:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_1]], align 4
165ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[CMP5:%.*]] = icmp ugt i32 [[TMP9]], [[TMP10]]
166ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    br i1 [[CMP5]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
167f90abac6SMike Rice // NORM:       cond.true:
168ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP11:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_1]], align 4
169f90abac6SMike Rice // NORM-NEXT:    br label [[COND_END:%.*]]
170f90abac6SMike Rice // NORM:       cond.false:
171ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP12:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
172f90abac6SMike Rice // NORM-NEXT:    br label [[COND_END]]
173f90abac6SMike Rice // NORM:       cond.end:
174ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[COND:%.*]] = phi i32 [ [[TMP11]], [[COND_TRUE]] ], [ [[TMP12]], [[COND_FALSE]] ]
175f90abac6SMike Rice // NORM-NEXT:    store i32 [[COND]], i32* [[DOTOMP_UB]], align 4
176ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP13:%.*]] = load i32, i32* [[DOTOMP_LB]], align 4
177ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i32 [[TMP13]], i32* [[DOTOMP_IV]], align 4
178f90abac6SMike Rice // NORM-NEXT:    br label [[OMP_INNER_FOR_COND:%.*]]
179f90abac6SMike Rice // NORM:       omp.inner.for.cond:
180ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP14:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
181ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP15:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
182ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[ADD:%.*]] = add i32 [[TMP15]], 1
183ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[CMP6:%.*]] = icmp ult i32 [[TMP14]], [[ADD]]
184ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    br i1 [[CMP6]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
185f90abac6SMike Rice // NORM:       omp.inner.for.body:
186ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP16:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
187ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[MUL:%.*]] = mul i32 [[TMP16]], 1
188ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[ADD7:%.*]] = add i32 0, [[MUL]]
189ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i32 [[ADD7]], i32* [[I4]], align 4
190ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP17:%.*]] = load i32, i32* [[I4]], align 4
191ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP18:%.*]] = load %struct.Point*, %struct.Point** [[TMP2]], align 8
192ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    call void @_Z4workR5PointiPKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[RED3]], i32 [[TMP17]], %struct.Point* [[TMP18]])
193f90abac6SMike Rice // NORM-NEXT:    br label [[OMP_BODY_CONTINUE:%.*]]
194f90abac6SMike Rice // NORM:       omp.body.continue:
195f90abac6SMike Rice // NORM-NEXT:    br label [[OMP_INNER_FOR_INC:%.*]]
196f90abac6SMike Rice // NORM:       omp.inner.for.inc:
197ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP19:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
198ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[ADD8:%.*]] = add i32 [[TMP19]], 1
199ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i32 [[ADD8]], i32* [[DOTOMP_IV]], align 4
200f90abac6SMike Rice // NORM-NEXT:    br label [[OMP_INNER_FOR_COND]]
201f90abac6SMike Rice // NORM:       omp.inner.for.end:
202f90abac6SMike Rice // NORM-NEXT:    br label [[OMP_LOOP_EXIT:%.*]]
203f90abac6SMike Rice // NORM:       omp.loop.exit:
204ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP20:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
205ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP21:%.*]] = load i32, i32* [[TMP20]], align 4
206ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    call void @__kmpc_for_static_fini(%struct.ident_t* @[[GLOB1]], i32 [[TMP21]])
207ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP22:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 0
208ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP23:%.*]] = bitcast %struct.Point* [[RED3]] to i8*
209ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i8* [[TMP23]], i8** [[TMP22]], align 8
210f90abac6SMike Rice // NORM-NEXT:    [[TMP24:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
211f90abac6SMike Rice // NORM-NEXT:    [[TMP25:%.*]] = load i32, i32* [[TMP24]], align 4
212ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP26:%.*]] = bitcast [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8*
213ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP27:%.*]] = call i32 @__kmpc_reduce_nowait(%struct.ident_t* @[[GLOB2:[0-9]+]], i32 [[TMP25]], i32 1, i64 8, i8* [[TMP26]], void (i8*, i8*)* @.omp.reduction.reduction_func, [8 x i32]* @.gomp_critical_user_.reduction.var)
214ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    switch i32 [[TMP27]], label [[DOTOMP_REDUCTION_DEFAULT:%.*]] [
215f90abac6SMike Rice // NORM-NEXT:    i32 1, label [[DOTOMP_REDUCTION_CASE1:%.*]]
216f90abac6SMike Rice // NORM-NEXT:    i32 2, label [[DOTOMP_REDUCTION_CASE2:%.*]]
217f90abac6SMike Rice // NORM-NEXT:    ]
218f90abac6SMike Rice // NORM:       .omp.reduction.case1:
219ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[CALL:%.*]] = call i64 @_ZNK5PointplERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP1]], %struct.Point* nonnull align 4 dereferenceable(8) [[RED3]])
220ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP28:%.*]] = bitcast %struct.Point* [[REF_TMP]] to i64*
221ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i64 [[CALL]], i64* [[TMP28]], align 4
222ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[CALL9:%.*]] = call nonnull align 4 dereferenceable(8) %struct.Point* @_ZN5PointaSERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP1]], %struct.Point* nonnull align 4 dereferenceable(8) [[REF_TMP]])
223ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    call void @__kmpc_end_reduce_nowait(%struct.ident_t* @[[GLOB2]], i32 [[TMP25]], [8 x i32]* @.gomp_critical_user_.reduction.var)
224f90abac6SMike Rice // NORM-NEXT:    br label [[DOTOMP_REDUCTION_DEFAULT]]
225f90abac6SMike Rice // NORM:       .omp.reduction.case2:
226ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP29:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
227ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP30:%.*]] = load i32, i32* [[TMP29]], align 4
228ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    call void @__kmpc_critical(%struct.ident_t* @[[GLOB3]], i32 [[TMP30]], [8 x i32]* @.gomp_critical_user_.atomic_reduction.var)
229ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[CALL11:%.*]] = call i64 @_ZNK5PointplERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP1]], %struct.Point* nonnull align 4 dereferenceable(8) [[RED3]])
230ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP31:%.*]] = bitcast %struct.Point* [[REF_TMP10]] to i64*
231ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i64 [[CALL11]], i64* [[TMP31]], align 4
232ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[CALL12:%.*]] = call nonnull align 4 dereferenceable(8) %struct.Point* @_ZN5PointaSERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP1]], %struct.Point* nonnull align 4 dereferenceable(8) [[REF_TMP10]])
233ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    call void @__kmpc_end_critical(%struct.ident_t* @[[GLOB3]], i32 [[TMP30]], [8 x i32]* @.gomp_critical_user_.atomic_reduction.var)
234f90abac6SMike Rice // NORM-NEXT:    br label [[DOTOMP_REDUCTION_DEFAULT]]
235f90abac6SMike Rice // NORM:       .omp.reduction.default:
236f90abac6SMike Rice // NORM-NEXT:    br label [[OMP_PRECOND_END]]
237f90abac6SMike Rice // NORM:       omp.precond.end:
238f90abac6SMike Rice // NORM-NEXT:    ret void
239f90abac6SMike Rice //
240f90abac6SMike Rice //
241f90abac6SMike Rice // NORM-LABEL: define {{[^@]+}}@.omp.reduction.reduction_func
242f90abac6SMike Rice // NORM-SAME: (i8* [[TMP0:%.*]], i8* [[TMP1:%.*]]) #[[ATTR5:[0-9]+]] {
243f90abac6SMike Rice // NORM-NEXT:  entry:
244f90abac6SMike Rice // NORM-NEXT:    [[DOTADDR:%.*]] = alloca i8*, align 8
245f90abac6SMike Rice // NORM-NEXT:    [[DOTADDR1:%.*]] = alloca i8*, align 8
246f90abac6SMike Rice // NORM-NEXT:    [[REF_TMP:%.*]] = alloca [[STRUCT_POINT:%.*]], align 4
247f90abac6SMike Rice // NORM-NEXT:    store i8* [[TMP0]], i8** [[DOTADDR]], align 8
248f90abac6SMike Rice // NORM-NEXT:    store i8* [[TMP1]], i8** [[DOTADDR1]], align 8
249f90abac6SMike Rice // NORM-NEXT:    [[TMP2:%.*]] = load i8*, i8** [[DOTADDR]], align 8
250f90abac6SMike Rice // NORM-NEXT:    [[TMP3:%.*]] = bitcast i8* [[TMP2]] to [1 x i8*]*
251f90abac6SMike Rice // NORM-NEXT:    [[TMP4:%.*]] = load i8*, i8** [[DOTADDR1]], align 8
252f90abac6SMike Rice // NORM-NEXT:    [[TMP5:%.*]] = bitcast i8* [[TMP4]] to [1 x i8*]*
253f90abac6SMike Rice // NORM-NEXT:    [[TMP6:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP5]], i64 0, i64 0
254f90abac6SMike Rice // NORM-NEXT:    [[TMP7:%.*]] = load i8*, i8** [[TMP6]], align 8
255f90abac6SMike Rice // NORM-NEXT:    [[TMP8:%.*]] = bitcast i8* [[TMP7]] to %struct.Point*
256f90abac6SMike Rice // NORM-NEXT:    [[TMP9:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP3]], i64 0, i64 0
257f90abac6SMike Rice // NORM-NEXT:    [[TMP10:%.*]] = load i8*, i8** [[TMP9]], align 8
258f90abac6SMike Rice // NORM-NEXT:    [[TMP11:%.*]] = bitcast i8* [[TMP10]] to %struct.Point*
25916d03818SRoman Lebedev // NORM-NEXT:    [[CALL:%.*]] = call i64 @_ZNK5PointplERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP11]], %struct.Point* nonnull align 4 dereferenceable(8) [[TMP8]])
260f90abac6SMike Rice // NORM-NEXT:    [[TMP12:%.*]] = bitcast %struct.Point* [[REF_TMP]] to i64*
261f90abac6SMike Rice // NORM-NEXT:    store i64 [[CALL]], i64* [[TMP12]], align 4
26216d03818SRoman Lebedev // NORM-NEXT:    [[CALL2:%.*]] = call nonnull align 4 dereferenceable(8) %struct.Point* @_ZN5PointaSERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP11]], %struct.Point* nonnull align 4 dereferenceable(8) [[REF_TMP]])
263f90abac6SMike Rice // NORM-NEXT:    ret void
264f90abac6SMike Rice //
265f90abac6SMike Rice //
266f90abac6SMike Rice // NORM-LABEL: define {{[^@]+}}@.omp_outlined..1
267ac90dfc4SGiorgis Georgakoudis // NORM-SAME: (i32* noalias [[DOTGLOBAL_TID_:%.*]], i32* noalias [[DOTBOUND_TID_:%.*]], i32* nonnull align 4 dereferenceable(4) [[N:%.*]], %struct.Point* nonnull align 4 dereferenceable(8) [[RED:%.*]], %struct.Point** nonnull align 8 dereferenceable(8) [[POINTS:%.*]]) #[[ATTR2]] {
268f90abac6SMike Rice // NORM-NEXT:  entry:
269f90abac6SMike Rice // NORM-NEXT:    [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
270f90abac6SMike Rice // NORM-NEXT:    [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
271ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[N_ADDR:%.*]] = alloca i32*, align 8
272ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[RED_ADDR:%.*]] = alloca %struct.Point*, align 8
273ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[POINTS_ADDR:%.*]] = alloca %struct.Point**, align 8
274f90abac6SMike Rice // NORM-NEXT:    [[DOTOMP_IV:%.*]] = alloca i32, align 4
275f90abac6SMike Rice // NORM-NEXT:    [[TMP:%.*]] = alloca i32, align 4
276f90abac6SMike Rice // NORM-NEXT:    [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
277f90abac6SMike Rice // NORM-NEXT:    [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
278f90abac6SMike Rice // NORM-NEXT:    [[I:%.*]] = alloca i32, align 4
279f90abac6SMike Rice // NORM-NEXT:    [[DOTOMP_LB:%.*]] = alloca i32, align 4
280f90abac6SMike Rice // NORM-NEXT:    [[DOTOMP_UB:%.*]] = alloca i32, align 4
281f90abac6SMike Rice // NORM-NEXT:    [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
282f90abac6SMike Rice // NORM-NEXT:    [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
283ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[RED3:%.*]] = alloca [[STRUCT_POINT:%.*]], align 4
284ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[I4:%.*]] = alloca i32, align 4
285f90abac6SMike Rice // NORM-NEXT:    [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [1 x i8*], align 8
286f90abac6SMike Rice // NORM-NEXT:    [[REF_TMP:%.*]] = alloca [[STRUCT_POINT]], align 4
287ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[REF_TMP10:%.*]] = alloca [[STRUCT_POINT]], align 4
288f90abac6SMike Rice // NORM-NEXT:    store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
289f90abac6SMike Rice // NORM-NEXT:    store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
290ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i32* [[N]], i32** [[N_ADDR]], align 8
291ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store %struct.Point* [[RED]], %struct.Point** [[RED_ADDR]], align 8
292ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store %struct.Point** [[POINTS]], %struct.Point*** [[POINTS_ADDR]], align 8
293ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP0:%.*]] = load i32*, i32** [[N_ADDR]], align 8
294ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP1:%.*]] = load %struct.Point*, %struct.Point** [[RED_ADDR]], align 8
295ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP2:%.*]] = load %struct.Point**, %struct.Point*** [[POINTS_ADDR]], align 8
296ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP3:%.*]] = load i32, i32* [[TMP0]], align 4
297ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i32 [[TMP3]], i32* [[DOTCAPTURE_EXPR_]], align 4
298ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP4:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_]], align 4
299ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[SUB:%.*]] = sub i32 [[TMP4]], 0
300f90abac6SMike Rice // NORM-NEXT:    [[DIV:%.*]] = udiv i32 [[SUB]], 1
301f90abac6SMike Rice // NORM-NEXT:    [[SUB2:%.*]] = sub i32 [[DIV]], 1
302f90abac6SMike Rice // NORM-NEXT:    store i32 [[SUB2]], i32* [[DOTCAPTURE_EXPR_1]], align 4
303f90abac6SMike Rice // NORM-NEXT:    store i32 0, i32* [[I]], align 4
304ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP5:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_]], align 4
305ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[CMP:%.*]] = icmp ult i32 0, [[TMP5]]
306f90abac6SMike Rice // NORM-NEXT:    br i1 [[CMP]], label [[OMP_PRECOND_THEN:%.*]], label [[OMP_PRECOND_END:%.*]]
307f90abac6SMike Rice // NORM:       omp.precond.then:
308f90abac6SMike Rice // NORM-NEXT:    store i32 0, i32* [[DOTOMP_LB]], align 4
309ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP6:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_1]], align 4
310ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i32 [[TMP6]], i32* [[DOTOMP_UB]], align 4
311f90abac6SMike Rice // NORM-NEXT:    store i32 1, i32* [[DOTOMP_STRIDE]], align 4
312f90abac6SMike Rice // NORM-NEXT:    store i32 0, i32* [[DOTOMP_IS_LAST]], align 4
313ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    call void @_ZN5PointC1Ev(%struct.Point* nonnull align 4 dereferenceable(8) [[RED3]]) #[[ATTR4]]
314ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP7:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
315ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP8:%.*]] = load i32, i32* [[TMP7]], align 4
316ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    call void @__kmpc_for_static_init_4u(%struct.ident_t* @[[GLOB1]], i32 [[TMP8]], i32 34, i32* [[DOTOMP_IS_LAST]], i32* [[DOTOMP_LB]], i32* [[DOTOMP_UB]], i32* [[DOTOMP_STRIDE]], i32 1, i32 1)
317ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP9:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
318ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP10:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_1]], align 4
319ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[CMP5:%.*]] = icmp ugt i32 [[TMP9]], [[TMP10]]
320ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    br i1 [[CMP5]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
321f90abac6SMike Rice // NORM:       cond.true:
322ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP11:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_1]], align 4
323f90abac6SMike Rice // NORM-NEXT:    br label [[COND_END:%.*]]
324f90abac6SMike Rice // NORM:       cond.false:
325ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP12:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
326f90abac6SMike Rice // NORM-NEXT:    br label [[COND_END]]
327f90abac6SMike Rice // NORM:       cond.end:
328ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[COND:%.*]] = phi i32 [ [[TMP11]], [[COND_TRUE]] ], [ [[TMP12]], [[COND_FALSE]] ]
329f90abac6SMike Rice // NORM-NEXT:    store i32 [[COND]], i32* [[DOTOMP_UB]], align 4
330ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP13:%.*]] = load i32, i32* [[DOTOMP_LB]], align 4
331ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i32 [[TMP13]], i32* [[DOTOMP_IV]], align 4
332f90abac6SMike Rice // NORM-NEXT:    br label [[OMP_INNER_FOR_COND:%.*]]
333f90abac6SMike Rice // NORM:       omp.inner.for.cond:
334ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP14:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
335ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP15:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
336ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[ADD:%.*]] = add i32 [[TMP15]], 1
337ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[CMP6:%.*]] = icmp ult i32 [[TMP14]], [[ADD]]
338ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    br i1 [[CMP6]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
339f90abac6SMike Rice // NORM:       omp.inner.for.body:
340ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP16:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
341ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[MUL:%.*]] = mul i32 [[TMP16]], 1
342ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[ADD7:%.*]] = add i32 0, [[MUL]]
343ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i32 [[ADD7]], i32* [[I4]], align 4
344ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP17:%.*]] = load i32, i32* [[I4]], align 4
345ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP18:%.*]] = load %struct.Point*, %struct.Point** [[TMP2]], align 8
346ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    call void @_Z4workR5PointiPKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[RED3]], i32 [[TMP17]], %struct.Point* [[TMP18]])
347f90abac6SMike Rice // NORM-NEXT:    br label [[OMP_BODY_CONTINUE:%.*]]
348f90abac6SMike Rice // NORM:       omp.body.continue:
349f90abac6SMike Rice // NORM-NEXT:    br label [[OMP_INNER_FOR_INC:%.*]]
350f90abac6SMike Rice // NORM:       omp.inner.for.inc:
351ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP19:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
352ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[ADD8:%.*]] = add i32 [[TMP19]], 1
353ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i32 [[ADD8]], i32* [[DOTOMP_IV]], align 4
354f90abac6SMike Rice // NORM-NEXT:    br label [[OMP_INNER_FOR_COND]]
355f90abac6SMike Rice // NORM:       omp.inner.for.end:
356f90abac6SMike Rice // NORM-NEXT:    br label [[OMP_LOOP_EXIT:%.*]]
357f90abac6SMike Rice // NORM:       omp.loop.exit:
358ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP20:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
359ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP21:%.*]] = load i32, i32* [[TMP20]], align 4
360ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    call void @__kmpc_for_static_fini(%struct.ident_t* @[[GLOB1]], i32 [[TMP21]])
361ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP22:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 0
362ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP23:%.*]] = bitcast %struct.Point* [[RED3]] to i8*
363ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i8* [[TMP23]], i8** [[TMP22]], align 8
364f90abac6SMike Rice // NORM-NEXT:    [[TMP24:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
365f90abac6SMike Rice // NORM-NEXT:    [[TMP25:%.*]] = load i32, i32* [[TMP24]], align 4
366ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP26:%.*]] = bitcast [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8*
367ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP27:%.*]] = call i32 @__kmpc_reduce_nowait(%struct.ident_t* @[[GLOB2]], i32 [[TMP25]], i32 1, i64 8, i8* [[TMP26]], void (i8*, i8*)* @.omp.reduction.reduction_func.2, [8 x i32]* @.gomp_critical_user_.reduction.var)
368ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    switch i32 [[TMP27]], label [[DOTOMP_REDUCTION_DEFAULT:%.*]] [
369f90abac6SMike Rice // NORM-NEXT:    i32 1, label [[DOTOMP_REDUCTION_CASE1:%.*]]
370f90abac6SMike Rice // NORM-NEXT:    i32 2, label [[DOTOMP_REDUCTION_CASE2:%.*]]
371f90abac6SMike Rice // NORM-NEXT:    ]
372f90abac6SMike Rice // NORM:       .omp.reduction.case1:
373ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[CALL:%.*]] = call i64 @_ZNK5PointplERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP1]], %struct.Point* nonnull align 4 dereferenceable(8) [[RED3]])
374ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP28:%.*]] = bitcast %struct.Point* [[REF_TMP]] to i64*
375ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i64 [[CALL]], i64* [[TMP28]], align 4
376ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[CALL9:%.*]] = call nonnull align 4 dereferenceable(8) %struct.Point* @_ZN5PointaSERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP1]], %struct.Point* nonnull align 4 dereferenceable(8) [[REF_TMP]])
377ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    call void @__kmpc_end_reduce_nowait(%struct.ident_t* @[[GLOB2]], i32 [[TMP25]], [8 x i32]* @.gomp_critical_user_.reduction.var)
378f90abac6SMike Rice // NORM-NEXT:    br label [[DOTOMP_REDUCTION_DEFAULT]]
379f90abac6SMike Rice // NORM:       .omp.reduction.case2:
380ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP29:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
381ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP30:%.*]] = load i32, i32* [[TMP29]], align 4
382ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    call void @__kmpc_critical(%struct.ident_t* @[[GLOB3]], i32 [[TMP30]], [8 x i32]* @.gomp_critical_user_.atomic_reduction.var)
383ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[CALL11:%.*]] = call i64 @_ZNK5PointplERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP1]], %struct.Point* nonnull align 4 dereferenceable(8) [[RED3]])
384ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP31:%.*]] = bitcast %struct.Point* [[REF_TMP10]] to i64*
385ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i64 [[CALL11]], i64* [[TMP31]], align 4
386ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[CALL12:%.*]] = call nonnull align 4 dereferenceable(8) %struct.Point* @_ZN5PointaSERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP1]], %struct.Point* nonnull align 4 dereferenceable(8) [[REF_TMP10]])
387ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    call void @__kmpc_end_critical(%struct.ident_t* @[[GLOB3]], i32 [[TMP30]], [8 x i32]* @.gomp_critical_user_.atomic_reduction.var)
388f90abac6SMike Rice // NORM-NEXT:    br label [[DOTOMP_REDUCTION_DEFAULT]]
389f90abac6SMike Rice // NORM:       .omp.reduction.default:
390f90abac6SMike Rice // NORM-NEXT:    br label [[OMP_PRECOND_END]]
391f90abac6SMike Rice // NORM:       omp.precond.end:
392f90abac6SMike Rice // NORM-NEXT:    ret void
393f90abac6SMike Rice //
394f90abac6SMike Rice //
395f90abac6SMike Rice // NORM-LABEL: define {{[^@]+}}@.omp.reduction.reduction_func.2
396f90abac6SMike Rice // NORM-SAME: (i8* [[TMP0:%.*]], i8* [[TMP1:%.*]]) #[[ATTR5]] {
397f90abac6SMike Rice // NORM-NEXT:  entry:
398f90abac6SMike Rice // NORM-NEXT:    [[DOTADDR:%.*]] = alloca i8*, align 8
399f90abac6SMike Rice // NORM-NEXT:    [[DOTADDR1:%.*]] = alloca i8*, align 8
400f90abac6SMike Rice // NORM-NEXT:    [[REF_TMP:%.*]] = alloca [[STRUCT_POINT:%.*]], align 4
401f90abac6SMike Rice // NORM-NEXT:    store i8* [[TMP0]], i8** [[DOTADDR]], align 8
402f90abac6SMike Rice // NORM-NEXT:    store i8* [[TMP1]], i8** [[DOTADDR1]], align 8
403f90abac6SMike Rice // NORM-NEXT:    [[TMP2:%.*]] = load i8*, i8** [[DOTADDR]], align 8
404f90abac6SMike Rice // NORM-NEXT:    [[TMP3:%.*]] = bitcast i8* [[TMP2]] to [1 x i8*]*
405f90abac6SMike Rice // NORM-NEXT:    [[TMP4:%.*]] = load i8*, i8** [[DOTADDR1]], align 8
406f90abac6SMike Rice // NORM-NEXT:    [[TMP5:%.*]] = bitcast i8* [[TMP4]] to [1 x i8*]*
407f90abac6SMike Rice // NORM-NEXT:    [[TMP6:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP5]], i64 0, i64 0
408f90abac6SMike Rice // NORM-NEXT:    [[TMP7:%.*]] = load i8*, i8** [[TMP6]], align 8
409f90abac6SMike Rice // NORM-NEXT:    [[TMP8:%.*]] = bitcast i8* [[TMP7]] to %struct.Point*
410f90abac6SMike Rice // NORM-NEXT:    [[TMP9:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP3]], i64 0, i64 0
411f90abac6SMike Rice // NORM-NEXT:    [[TMP10:%.*]] = load i8*, i8** [[TMP9]], align 8
412f90abac6SMike Rice // NORM-NEXT:    [[TMP11:%.*]] = bitcast i8* [[TMP10]] to %struct.Point*
41316d03818SRoman Lebedev // NORM-NEXT:    [[CALL:%.*]] = call i64 @_ZNK5PointplERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP11]], %struct.Point* nonnull align 4 dereferenceable(8) [[TMP8]])
414f90abac6SMike Rice // NORM-NEXT:    [[TMP12:%.*]] = bitcast %struct.Point* [[REF_TMP]] to i64*
415f90abac6SMike Rice // NORM-NEXT:    store i64 [[CALL]], i64* [[TMP12]], align 4
41616d03818SRoman Lebedev // NORM-NEXT:    [[CALL2:%.*]] = call nonnull align 4 dereferenceable(8) %struct.Point* @_ZN5PointaSERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP11]], %struct.Point* nonnull align 4 dereferenceable(8) [[REF_TMP]])
417f90abac6SMike Rice // NORM-NEXT:    ret void
418f90abac6SMike Rice //
419f90abac6SMike Rice //
420f90abac6SMike Rice // NORM-LABEL: define {{[^@]+}}@.omp_outlined..3
421ac90dfc4SGiorgis Georgakoudis // NORM-SAME: (i32* noalias [[DOTGLOBAL_TID_:%.*]], i32* noalias [[DOTBOUND_TID_:%.*]], i32* nonnull align 4 dereferenceable(4) [[N:%.*]], %struct.Point* nonnull align 4 dereferenceable(8) [[RED:%.*]], %struct.Point** nonnull align 8 dereferenceable(8) [[POINTS:%.*]]) #[[ATTR2]] {
422f90abac6SMike Rice // NORM-NEXT:  entry:
423f90abac6SMike Rice // NORM-NEXT:    [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
424f90abac6SMike Rice // NORM-NEXT:    [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
425ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[N_ADDR:%.*]] = alloca i32*, align 8
426ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[RED_ADDR:%.*]] = alloca %struct.Point*, align 8
427ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[POINTS_ADDR:%.*]] = alloca %struct.Point**, align 8
428f90abac6SMike Rice // NORM-NEXT:    [[DOTOMP_IV:%.*]] = alloca i32, align 4
429f90abac6SMike Rice // NORM-NEXT:    [[TMP:%.*]] = alloca i32, align 4
430f90abac6SMike Rice // NORM-NEXT:    [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
431f90abac6SMike Rice // NORM-NEXT:    [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
432f90abac6SMike Rice // NORM-NEXT:    [[I:%.*]] = alloca i32, align 4
433f90abac6SMike Rice // NORM-NEXT:    [[DOTOMP_LB:%.*]] = alloca i32, align 4
434f90abac6SMike Rice // NORM-NEXT:    [[DOTOMP_UB:%.*]] = alloca i32, align 4
435f90abac6SMike Rice // NORM-NEXT:    [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
436f90abac6SMike Rice // NORM-NEXT:    [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
437ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[RED3:%.*]] = alloca [[STRUCT_POINT:%.*]], align 4
438ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[I4:%.*]] = alloca i32, align 4
439f90abac6SMike Rice // NORM-NEXT:    [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [1 x i8*], align 8
440f90abac6SMike Rice // NORM-NEXT:    [[REF_TMP:%.*]] = alloca [[STRUCT_POINT]], align 4
441ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[REF_TMP10:%.*]] = alloca [[STRUCT_POINT]], align 4
442f90abac6SMike Rice // NORM-NEXT:    store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
443f90abac6SMike Rice // NORM-NEXT:    store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
444ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i32* [[N]], i32** [[N_ADDR]], align 8
445ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store %struct.Point* [[RED]], %struct.Point** [[RED_ADDR]], align 8
446ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store %struct.Point** [[POINTS]], %struct.Point*** [[POINTS_ADDR]], align 8
447ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP0:%.*]] = load i32*, i32** [[N_ADDR]], align 8
448ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP1:%.*]] = load %struct.Point*, %struct.Point** [[RED_ADDR]], align 8
449ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP2:%.*]] = load %struct.Point**, %struct.Point*** [[POINTS_ADDR]], align 8
450ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP3:%.*]] = load i32, i32* [[TMP0]], align 4
451ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i32 [[TMP3]], i32* [[DOTCAPTURE_EXPR_]], align 4
452ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP4:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_]], align 4
453ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[SUB:%.*]] = sub i32 [[TMP4]], 0
454f90abac6SMike Rice // NORM-NEXT:    [[DIV:%.*]] = udiv i32 [[SUB]], 1
455f90abac6SMike Rice // NORM-NEXT:    [[SUB2:%.*]] = sub i32 [[DIV]], 1
456f90abac6SMike Rice // NORM-NEXT:    store i32 [[SUB2]], i32* [[DOTCAPTURE_EXPR_1]], align 4
457f90abac6SMike Rice // NORM-NEXT:    store i32 0, i32* [[I]], align 4
458ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP5:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_]], align 4
459ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[CMP:%.*]] = icmp ult i32 0, [[TMP5]]
460f90abac6SMike Rice // NORM-NEXT:    br i1 [[CMP]], label [[OMP_PRECOND_THEN:%.*]], label [[OMP_PRECOND_END:%.*]]
461f90abac6SMike Rice // NORM:       omp.precond.then:
462f90abac6SMike Rice // NORM-NEXT:    store i32 0, i32* [[DOTOMP_LB]], align 4
463ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP6:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_1]], align 4
464ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i32 [[TMP6]], i32* [[DOTOMP_UB]], align 4
465f90abac6SMike Rice // NORM-NEXT:    store i32 1, i32* [[DOTOMP_STRIDE]], align 4
466f90abac6SMike Rice // NORM-NEXT:    store i32 0, i32* [[DOTOMP_IS_LAST]], align 4
467ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    call void @_ZN5PointC1Ev(%struct.Point* nonnull align 4 dereferenceable(8) [[RED3]]) #[[ATTR4]]
468ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP7:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
469ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP8:%.*]] = load i32, i32* [[TMP7]], align 4
470ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    call void @__kmpc_for_static_init_4u(%struct.ident_t* @[[GLOB1]], i32 [[TMP8]], i32 34, i32* [[DOTOMP_IS_LAST]], i32* [[DOTOMP_LB]], i32* [[DOTOMP_UB]], i32* [[DOTOMP_STRIDE]], i32 1, i32 1)
471ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP9:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
472ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP10:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_1]], align 4
473ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[CMP5:%.*]] = icmp ugt i32 [[TMP9]], [[TMP10]]
474ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    br i1 [[CMP5]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
475f90abac6SMike Rice // NORM:       cond.true:
476ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP11:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_1]], align 4
477f90abac6SMike Rice // NORM-NEXT:    br label [[COND_END:%.*]]
478f90abac6SMike Rice // NORM:       cond.false:
479ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP12:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
480f90abac6SMike Rice // NORM-NEXT:    br label [[COND_END]]
481f90abac6SMike Rice // NORM:       cond.end:
482ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[COND:%.*]] = phi i32 [ [[TMP11]], [[COND_TRUE]] ], [ [[TMP12]], [[COND_FALSE]] ]
483f90abac6SMike Rice // NORM-NEXT:    store i32 [[COND]], i32* [[DOTOMP_UB]], align 4
484ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP13:%.*]] = load i32, i32* [[DOTOMP_LB]], align 4
485ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i32 [[TMP13]], i32* [[DOTOMP_IV]], align 4
486f90abac6SMike Rice // NORM-NEXT:    br label [[OMP_INNER_FOR_COND:%.*]]
487f90abac6SMike Rice // NORM:       omp.inner.for.cond:
488ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP14:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
489ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP15:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
490ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[ADD:%.*]] = add i32 [[TMP15]], 1
491ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[CMP6:%.*]] = icmp ult i32 [[TMP14]], [[ADD]]
492ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    br i1 [[CMP6]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
493f90abac6SMike Rice // NORM:       omp.inner.for.body:
494ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP16:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
495ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[MUL:%.*]] = mul i32 [[TMP16]], 1
496ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[ADD7:%.*]] = add i32 0, [[MUL]]
497ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i32 [[ADD7]], i32* [[I4]], align 4
498ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP17:%.*]] = load i32, i32* [[I4]], align 4
499ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP18:%.*]] = load %struct.Point*, %struct.Point** [[TMP2]], align 8
500ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    call void @_Z4workR5PointiPKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[RED3]], i32 [[TMP17]], %struct.Point* [[TMP18]])
501f90abac6SMike Rice // NORM-NEXT:    br label [[OMP_BODY_CONTINUE:%.*]]
502f90abac6SMike Rice // NORM:       omp.body.continue:
503f90abac6SMike Rice // NORM-NEXT:    br label [[OMP_INNER_FOR_INC:%.*]]
504f90abac6SMike Rice // NORM:       omp.inner.for.inc:
505ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP19:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
506ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[ADD8:%.*]] = add i32 [[TMP19]], 1
507ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i32 [[ADD8]], i32* [[DOTOMP_IV]], align 4
508f90abac6SMike Rice // NORM-NEXT:    br label [[OMP_INNER_FOR_COND]]
509f90abac6SMike Rice // NORM:       omp.inner.for.end:
510f90abac6SMike Rice // NORM-NEXT:    br label [[OMP_LOOP_EXIT:%.*]]
511f90abac6SMike Rice // NORM:       omp.loop.exit:
512ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP20:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
513ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP21:%.*]] = load i32, i32* [[TMP20]], align 4
514ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    call void @__kmpc_for_static_fini(%struct.ident_t* @[[GLOB1]], i32 [[TMP21]])
515ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP22:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 0
516ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP23:%.*]] = bitcast %struct.Point* [[RED3]] to i8*
517ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i8* [[TMP23]], i8** [[TMP22]], align 8
518f90abac6SMike Rice // NORM-NEXT:    [[TMP24:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
519f90abac6SMike Rice // NORM-NEXT:    [[TMP25:%.*]] = load i32, i32* [[TMP24]], align 4
520ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP26:%.*]] = bitcast [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8*
521ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP27:%.*]] = call i32 @__kmpc_reduce_nowait(%struct.ident_t* @[[GLOB2]], i32 [[TMP25]], i32 1, i64 8, i8* [[TMP26]], void (i8*, i8*)* @.omp.reduction.reduction_func.4, [8 x i32]* @.gomp_critical_user_.reduction.var)
522ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    switch i32 [[TMP27]], label [[DOTOMP_REDUCTION_DEFAULT:%.*]] [
523f90abac6SMike Rice // NORM-NEXT:    i32 1, label [[DOTOMP_REDUCTION_CASE1:%.*]]
524f90abac6SMike Rice // NORM-NEXT:    i32 2, label [[DOTOMP_REDUCTION_CASE2:%.*]]
525f90abac6SMike Rice // NORM-NEXT:    ]
526f90abac6SMike Rice // NORM:       .omp.reduction.case1:
527ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[CALL:%.*]] = call i64 @_ZNK5PointmlERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP1]], %struct.Point* nonnull align 4 dereferenceable(8) [[RED3]])
528ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP28:%.*]] = bitcast %struct.Point* [[REF_TMP]] to i64*
529ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i64 [[CALL]], i64* [[TMP28]], align 4
530ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[CALL9:%.*]] = call nonnull align 4 dereferenceable(8) %struct.Point* @_ZN5PointaSERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP1]], %struct.Point* nonnull align 4 dereferenceable(8) [[REF_TMP]])
531ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    call void @__kmpc_end_reduce_nowait(%struct.ident_t* @[[GLOB2]], i32 [[TMP25]], [8 x i32]* @.gomp_critical_user_.reduction.var)
532f90abac6SMike Rice // NORM-NEXT:    br label [[DOTOMP_REDUCTION_DEFAULT]]
533f90abac6SMike Rice // NORM:       .omp.reduction.case2:
534ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP29:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
535ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP30:%.*]] = load i32, i32* [[TMP29]], align 4
536ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    call void @__kmpc_critical(%struct.ident_t* @[[GLOB3]], i32 [[TMP30]], [8 x i32]* @.gomp_critical_user_.atomic_reduction.var)
537ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[CALL11:%.*]] = call i64 @_ZNK5PointmlERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP1]], %struct.Point* nonnull align 4 dereferenceable(8) [[RED3]])
538ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP31:%.*]] = bitcast %struct.Point* [[REF_TMP10]] to i64*
539ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i64 [[CALL11]], i64* [[TMP31]], align 4
540ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[CALL12:%.*]] = call nonnull align 4 dereferenceable(8) %struct.Point* @_ZN5PointaSERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP1]], %struct.Point* nonnull align 4 dereferenceable(8) [[REF_TMP10]])
541ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    call void @__kmpc_end_critical(%struct.ident_t* @[[GLOB3]], i32 [[TMP30]], [8 x i32]* @.gomp_critical_user_.atomic_reduction.var)
542f90abac6SMike Rice // NORM-NEXT:    br label [[DOTOMP_REDUCTION_DEFAULT]]
543f90abac6SMike Rice // NORM:       .omp.reduction.default:
544f90abac6SMike Rice // NORM-NEXT:    br label [[OMP_PRECOND_END]]
545f90abac6SMike Rice // NORM:       omp.precond.end:
546f90abac6SMike Rice // NORM-NEXT:    ret void
547f90abac6SMike Rice //
548f90abac6SMike Rice //
549f90abac6SMike Rice // NORM-LABEL: define {{[^@]+}}@.omp.reduction.reduction_func.4
550f90abac6SMike Rice // NORM-SAME: (i8* [[TMP0:%.*]], i8* [[TMP1:%.*]]) #[[ATTR5]] {
551f90abac6SMike Rice // NORM-NEXT:  entry:
552f90abac6SMike Rice // NORM-NEXT:    [[DOTADDR:%.*]] = alloca i8*, align 8
553f90abac6SMike Rice // NORM-NEXT:    [[DOTADDR1:%.*]] = alloca i8*, align 8
554f90abac6SMike Rice // NORM-NEXT:    [[REF_TMP:%.*]] = alloca [[STRUCT_POINT:%.*]], align 4
555f90abac6SMike Rice // NORM-NEXT:    store i8* [[TMP0]], i8** [[DOTADDR]], align 8
556f90abac6SMike Rice // NORM-NEXT:    store i8* [[TMP1]], i8** [[DOTADDR1]], align 8
557f90abac6SMike Rice // NORM-NEXT:    [[TMP2:%.*]] = load i8*, i8** [[DOTADDR]], align 8
558f90abac6SMike Rice // NORM-NEXT:    [[TMP3:%.*]] = bitcast i8* [[TMP2]] to [1 x i8*]*
559f90abac6SMike Rice // NORM-NEXT:    [[TMP4:%.*]] = load i8*, i8** [[DOTADDR1]], align 8
560f90abac6SMike Rice // NORM-NEXT:    [[TMP5:%.*]] = bitcast i8* [[TMP4]] to [1 x i8*]*
561f90abac6SMike Rice // NORM-NEXT:    [[TMP6:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP5]], i64 0, i64 0
562f90abac6SMike Rice // NORM-NEXT:    [[TMP7:%.*]] = load i8*, i8** [[TMP6]], align 8
563f90abac6SMike Rice // NORM-NEXT:    [[TMP8:%.*]] = bitcast i8* [[TMP7]] to %struct.Point*
564f90abac6SMike Rice // NORM-NEXT:    [[TMP9:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP3]], i64 0, i64 0
565f90abac6SMike Rice // NORM-NEXT:    [[TMP10:%.*]] = load i8*, i8** [[TMP9]], align 8
566f90abac6SMike Rice // NORM-NEXT:    [[TMP11:%.*]] = bitcast i8* [[TMP10]] to %struct.Point*
56716d03818SRoman Lebedev // NORM-NEXT:    [[CALL:%.*]] = call i64 @_ZNK5PointmlERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP11]], %struct.Point* nonnull align 4 dereferenceable(8) [[TMP8]])
568f90abac6SMike Rice // NORM-NEXT:    [[TMP12:%.*]] = bitcast %struct.Point* [[REF_TMP]] to i64*
569f90abac6SMike Rice // NORM-NEXT:    store i64 [[CALL]], i64* [[TMP12]], align 4
57016d03818SRoman Lebedev // NORM-NEXT:    [[CALL2:%.*]] = call nonnull align 4 dereferenceable(8) %struct.Point* @_ZN5PointaSERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP11]], %struct.Point* nonnull align 4 dereferenceable(8) [[REF_TMP]])
571f90abac6SMike Rice // NORM-NEXT:    ret void
572f90abac6SMike Rice //
573f90abac6SMike Rice //
574f90abac6SMike Rice // NORM-LABEL: define {{[^@]+}}@.omp_outlined..5
575ac90dfc4SGiorgis Georgakoudis // NORM-SAME: (i32* noalias [[DOTGLOBAL_TID_:%.*]], i32* noalias [[DOTBOUND_TID_:%.*]], i32* nonnull align 4 dereferenceable(4) [[N:%.*]], %struct.Point* nonnull align 4 dereferenceable(8) [[RED:%.*]], %struct.Point** nonnull align 8 dereferenceable(8) [[POINTS:%.*]]) #[[ATTR2]] {
576f90abac6SMike Rice // NORM-NEXT:  entry:
577f90abac6SMike Rice // NORM-NEXT:    [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
578f90abac6SMike Rice // NORM-NEXT:    [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
579ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[N_ADDR:%.*]] = alloca i32*, align 8
580ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[RED_ADDR:%.*]] = alloca %struct.Point*, align 8
581ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[POINTS_ADDR:%.*]] = alloca %struct.Point**, align 8
582f90abac6SMike Rice // NORM-NEXT:    [[DOTOMP_IV:%.*]] = alloca i32, align 4
583f90abac6SMike Rice // NORM-NEXT:    [[TMP:%.*]] = alloca i32, align 4
584f90abac6SMike Rice // NORM-NEXT:    [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
585f90abac6SMike Rice // NORM-NEXT:    [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
586f90abac6SMike Rice // NORM-NEXT:    [[I:%.*]] = alloca i32, align 4
587f90abac6SMike Rice // NORM-NEXT:    [[DOTOMP_LB:%.*]] = alloca i32, align 4
588f90abac6SMike Rice // NORM-NEXT:    [[DOTOMP_UB:%.*]] = alloca i32, align 4
589f90abac6SMike Rice // NORM-NEXT:    [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
590f90abac6SMike Rice // NORM-NEXT:    [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
591ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[RED3:%.*]] = alloca [[STRUCT_POINT:%.*]], align 4
592ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[I4:%.*]] = alloca i32, align 4
593f90abac6SMike Rice // NORM-NEXT:    [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [1 x i8*], align 8
594f90abac6SMike Rice // NORM-NEXT:    [[REF_TMP:%.*]] = alloca [[STRUCT_POINT]], align 4
595ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[REF_TMP10:%.*]] = alloca [[STRUCT_POINT]], align 4
596f90abac6SMike Rice // NORM-NEXT:    store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
597f90abac6SMike Rice // NORM-NEXT:    store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
598ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i32* [[N]], i32** [[N_ADDR]], align 8
599ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store %struct.Point* [[RED]], %struct.Point** [[RED_ADDR]], align 8
600ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store %struct.Point** [[POINTS]], %struct.Point*** [[POINTS_ADDR]], align 8
601ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP0:%.*]] = load i32*, i32** [[N_ADDR]], align 8
602ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP1:%.*]] = load %struct.Point*, %struct.Point** [[RED_ADDR]], align 8
603ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP2:%.*]] = load %struct.Point**, %struct.Point*** [[POINTS_ADDR]], align 8
604ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP3:%.*]] = load i32, i32* [[TMP0]], align 4
605ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i32 [[TMP3]], i32* [[DOTCAPTURE_EXPR_]], align 4
606ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP4:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_]], align 4
607ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[SUB:%.*]] = sub i32 [[TMP4]], 0
608f90abac6SMike Rice // NORM-NEXT:    [[DIV:%.*]] = udiv i32 [[SUB]], 1
609f90abac6SMike Rice // NORM-NEXT:    [[SUB2:%.*]] = sub i32 [[DIV]], 1
610f90abac6SMike Rice // NORM-NEXT:    store i32 [[SUB2]], i32* [[DOTCAPTURE_EXPR_1]], align 4
611f90abac6SMike Rice // NORM-NEXT:    store i32 0, i32* [[I]], align 4
612ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP5:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_]], align 4
613ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[CMP:%.*]] = icmp ult i32 0, [[TMP5]]
614f90abac6SMike Rice // NORM-NEXT:    br i1 [[CMP]], label [[OMP_PRECOND_THEN:%.*]], label [[OMP_PRECOND_END:%.*]]
615f90abac6SMike Rice // NORM:       omp.precond.then:
616f90abac6SMike Rice // NORM-NEXT:    store i32 0, i32* [[DOTOMP_LB]], align 4
617ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP6:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_1]], align 4
618ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i32 [[TMP6]], i32* [[DOTOMP_UB]], align 4
619f90abac6SMike Rice // NORM-NEXT:    store i32 1, i32* [[DOTOMP_STRIDE]], align 4
620f90abac6SMike Rice // NORM-NEXT:    store i32 0, i32* [[DOTOMP_IS_LAST]], align 4
621ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    call void @_ZN5PointC1Ev(%struct.Point* nonnull align 4 dereferenceable(8) [[RED3]]) #[[ATTR4]]
622ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP7:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
623ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP8:%.*]] = load i32, i32* [[TMP7]], align 4
624ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    call void @__kmpc_for_static_init_4u(%struct.ident_t* @[[GLOB1]], i32 [[TMP8]], i32 34, i32* [[DOTOMP_IS_LAST]], i32* [[DOTOMP_LB]], i32* [[DOTOMP_UB]], i32* [[DOTOMP_STRIDE]], i32 1, i32 1)
625ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP9:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
626ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP10:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_1]], align 4
627ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[CMP5:%.*]] = icmp ugt i32 [[TMP9]], [[TMP10]]
628ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    br i1 [[CMP5]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
629f90abac6SMike Rice // NORM:       cond.true:
630ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP11:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_1]], align 4
631f90abac6SMike Rice // NORM-NEXT:    br label [[COND_END:%.*]]
632f90abac6SMike Rice // NORM:       cond.false:
633ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP12:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
634f90abac6SMike Rice // NORM-NEXT:    br label [[COND_END]]
635f90abac6SMike Rice // NORM:       cond.end:
636ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[COND:%.*]] = phi i32 [ [[TMP11]], [[COND_TRUE]] ], [ [[TMP12]], [[COND_FALSE]] ]
637f90abac6SMike Rice // NORM-NEXT:    store i32 [[COND]], i32* [[DOTOMP_UB]], align 4
638ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP13:%.*]] = load i32, i32* [[DOTOMP_LB]], align 4
639ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i32 [[TMP13]], i32* [[DOTOMP_IV]], align 4
640f90abac6SMike Rice // NORM-NEXT:    br label [[OMP_INNER_FOR_COND:%.*]]
641f90abac6SMike Rice // NORM:       omp.inner.for.cond:
642ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP14:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
643ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP15:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
644ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[ADD:%.*]] = add i32 [[TMP15]], 1
645ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[CMP6:%.*]] = icmp ult i32 [[TMP14]], [[ADD]]
646ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    br i1 [[CMP6]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
647f90abac6SMike Rice // NORM:       omp.inner.for.body:
648ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP16:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
649ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[MUL:%.*]] = mul i32 [[TMP16]], 1
650ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[ADD7:%.*]] = add i32 0, [[MUL]]
651ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i32 [[ADD7]], i32* [[I4]], align 4
652ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP17:%.*]] = load i32, i32* [[I4]], align 4
653ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP18:%.*]] = load %struct.Point*, %struct.Point** [[TMP2]], align 8
654ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    call void @_Z4workR5PointiPKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[RED3]], i32 [[TMP17]], %struct.Point* [[TMP18]])
655f90abac6SMike Rice // NORM-NEXT:    br label [[OMP_BODY_CONTINUE:%.*]]
656f90abac6SMike Rice // NORM:       omp.body.continue:
657f90abac6SMike Rice // NORM-NEXT:    br label [[OMP_INNER_FOR_INC:%.*]]
658f90abac6SMike Rice // NORM:       omp.inner.for.inc:
659ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP19:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
660ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[ADD8:%.*]] = add i32 [[TMP19]], 1
661ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i32 [[ADD8]], i32* [[DOTOMP_IV]], align 4
662f90abac6SMike Rice // NORM-NEXT:    br label [[OMP_INNER_FOR_COND]]
663f90abac6SMike Rice // NORM:       omp.inner.for.end:
664f90abac6SMike Rice // NORM-NEXT:    br label [[OMP_LOOP_EXIT:%.*]]
665f90abac6SMike Rice // NORM:       omp.loop.exit:
666ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP20:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
667ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP21:%.*]] = load i32, i32* [[TMP20]], align 4
668ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    call void @__kmpc_for_static_fini(%struct.ident_t* @[[GLOB1]], i32 [[TMP21]])
669ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP22:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 0
670ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP23:%.*]] = bitcast %struct.Point* [[RED3]] to i8*
671ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i8* [[TMP23]], i8** [[TMP22]], align 8
672f90abac6SMike Rice // NORM-NEXT:    [[TMP24:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
673f90abac6SMike Rice // NORM-NEXT:    [[TMP25:%.*]] = load i32, i32* [[TMP24]], align 4
674ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP26:%.*]] = bitcast [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8*
675ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP27:%.*]] = call i32 @__kmpc_reduce_nowait(%struct.ident_t* @[[GLOB2]], i32 [[TMP25]], i32 1, i64 8, i8* [[TMP26]], void (i8*, i8*)* @.omp.reduction.reduction_func.6, [8 x i32]* @.gomp_critical_user_.reduction.var)
676ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    switch i32 [[TMP27]], label [[DOTOMP_REDUCTION_DEFAULT:%.*]] [
677f90abac6SMike Rice // NORM-NEXT:    i32 1, label [[DOTOMP_REDUCTION_CASE1:%.*]]
678f90abac6SMike Rice // NORM-NEXT:    i32 2, label [[DOTOMP_REDUCTION_CASE2:%.*]]
679f90abac6SMike Rice // NORM-NEXT:    ]
680f90abac6SMike Rice // NORM:       .omp.reduction.case1:
681ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[CALL:%.*]] = call i64 @_ZNK5PointanERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP1]], %struct.Point* nonnull align 4 dereferenceable(8) [[RED3]])
682ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP28:%.*]] = bitcast %struct.Point* [[REF_TMP]] to i64*
683ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i64 [[CALL]], i64* [[TMP28]], align 4
684ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[CALL9:%.*]] = call nonnull align 4 dereferenceable(8) %struct.Point* @_ZN5PointaSERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP1]], %struct.Point* nonnull align 4 dereferenceable(8) [[REF_TMP]])
685ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    call void @__kmpc_end_reduce_nowait(%struct.ident_t* @[[GLOB2]], i32 [[TMP25]], [8 x i32]* @.gomp_critical_user_.reduction.var)
686f90abac6SMike Rice // NORM-NEXT:    br label [[DOTOMP_REDUCTION_DEFAULT]]
687f90abac6SMike Rice // NORM:       .omp.reduction.case2:
688ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP29:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
689ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP30:%.*]] = load i32, i32* [[TMP29]], align 4
690ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    call void @__kmpc_critical(%struct.ident_t* @[[GLOB3]], i32 [[TMP30]], [8 x i32]* @.gomp_critical_user_.atomic_reduction.var)
691ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[CALL11:%.*]] = call i64 @_ZNK5PointanERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP1]], %struct.Point* nonnull align 4 dereferenceable(8) [[RED3]])
692ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP31:%.*]] = bitcast %struct.Point* [[REF_TMP10]] to i64*
693ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i64 [[CALL11]], i64* [[TMP31]], align 4
694ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[CALL12:%.*]] = call nonnull align 4 dereferenceable(8) %struct.Point* @_ZN5PointaSERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP1]], %struct.Point* nonnull align 4 dereferenceable(8) [[REF_TMP10]])
695ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    call void @__kmpc_end_critical(%struct.ident_t* @[[GLOB3]], i32 [[TMP30]], [8 x i32]* @.gomp_critical_user_.atomic_reduction.var)
696f90abac6SMike Rice // NORM-NEXT:    br label [[DOTOMP_REDUCTION_DEFAULT]]
697f90abac6SMike Rice // NORM:       .omp.reduction.default:
698f90abac6SMike Rice // NORM-NEXT:    br label [[OMP_PRECOND_END]]
699f90abac6SMike Rice // NORM:       omp.precond.end:
700f90abac6SMike Rice // NORM-NEXT:    ret void
701f90abac6SMike Rice //
702f90abac6SMike Rice //
703f90abac6SMike Rice // NORM-LABEL: define {{[^@]+}}@.omp.reduction.reduction_func.6
704f90abac6SMike Rice // NORM-SAME: (i8* [[TMP0:%.*]], i8* [[TMP1:%.*]]) #[[ATTR5]] {
705f90abac6SMike Rice // NORM-NEXT:  entry:
706f90abac6SMike Rice // NORM-NEXT:    [[DOTADDR:%.*]] = alloca i8*, align 8
707f90abac6SMike Rice // NORM-NEXT:    [[DOTADDR1:%.*]] = alloca i8*, align 8
708f90abac6SMike Rice // NORM-NEXT:    [[REF_TMP:%.*]] = alloca [[STRUCT_POINT:%.*]], align 4
709f90abac6SMike Rice // NORM-NEXT:    store i8* [[TMP0]], i8** [[DOTADDR]], align 8
710f90abac6SMike Rice // NORM-NEXT:    store i8* [[TMP1]], i8** [[DOTADDR1]], align 8
711f90abac6SMike Rice // NORM-NEXT:    [[TMP2:%.*]] = load i8*, i8** [[DOTADDR]], align 8
712f90abac6SMike Rice // NORM-NEXT:    [[TMP3:%.*]] = bitcast i8* [[TMP2]] to [1 x i8*]*
713f90abac6SMike Rice // NORM-NEXT:    [[TMP4:%.*]] = load i8*, i8** [[DOTADDR1]], align 8
714f90abac6SMike Rice // NORM-NEXT:    [[TMP5:%.*]] = bitcast i8* [[TMP4]] to [1 x i8*]*
715f90abac6SMike Rice // NORM-NEXT:    [[TMP6:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP5]], i64 0, i64 0
716f90abac6SMike Rice // NORM-NEXT:    [[TMP7:%.*]] = load i8*, i8** [[TMP6]], align 8
717f90abac6SMike Rice // NORM-NEXT:    [[TMP8:%.*]] = bitcast i8* [[TMP7]] to %struct.Point*
718f90abac6SMike Rice // NORM-NEXT:    [[TMP9:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP3]], i64 0, i64 0
719f90abac6SMike Rice // NORM-NEXT:    [[TMP10:%.*]] = load i8*, i8** [[TMP9]], align 8
720f90abac6SMike Rice // NORM-NEXT:    [[TMP11:%.*]] = bitcast i8* [[TMP10]] to %struct.Point*
72116d03818SRoman Lebedev // NORM-NEXT:    [[CALL:%.*]] = call i64 @_ZNK5PointanERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP11]], %struct.Point* nonnull align 4 dereferenceable(8) [[TMP8]])
722f90abac6SMike Rice // NORM-NEXT:    [[TMP12:%.*]] = bitcast %struct.Point* [[REF_TMP]] to i64*
723f90abac6SMike Rice // NORM-NEXT:    store i64 [[CALL]], i64* [[TMP12]], align 4
72416d03818SRoman Lebedev // NORM-NEXT:    [[CALL2:%.*]] = call nonnull align 4 dereferenceable(8) %struct.Point* @_ZN5PointaSERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP11]], %struct.Point* nonnull align 4 dereferenceable(8) [[REF_TMP]])
725f90abac6SMike Rice // NORM-NEXT:    ret void
726f90abac6SMike Rice //
727f90abac6SMike Rice //
728f90abac6SMike Rice // NORM-LABEL: define {{[^@]+}}@.omp_outlined..7
729ac90dfc4SGiorgis Georgakoudis // NORM-SAME: (i32* noalias [[DOTGLOBAL_TID_:%.*]], i32* noalias [[DOTBOUND_TID_:%.*]], i32* nonnull align 4 dereferenceable(4) [[N:%.*]], %struct.Point* nonnull align 4 dereferenceable(8) [[RED:%.*]], %struct.Point** nonnull align 8 dereferenceable(8) [[POINTS:%.*]]) #[[ATTR2]] {
730f90abac6SMike Rice // NORM-NEXT:  entry:
731f90abac6SMike Rice // NORM-NEXT:    [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
732f90abac6SMike Rice // NORM-NEXT:    [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
733ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[N_ADDR:%.*]] = alloca i32*, align 8
734ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[RED_ADDR:%.*]] = alloca %struct.Point*, align 8
735ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[POINTS_ADDR:%.*]] = alloca %struct.Point**, align 8
736f90abac6SMike Rice // NORM-NEXT:    [[DOTOMP_IV:%.*]] = alloca i32, align 4
737f90abac6SMike Rice // NORM-NEXT:    [[TMP:%.*]] = alloca i32, align 4
738f90abac6SMike Rice // NORM-NEXT:    [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
739f90abac6SMike Rice // NORM-NEXT:    [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
740f90abac6SMike Rice // NORM-NEXT:    [[I:%.*]] = alloca i32, align 4
741f90abac6SMike Rice // NORM-NEXT:    [[DOTOMP_LB:%.*]] = alloca i32, align 4
742f90abac6SMike Rice // NORM-NEXT:    [[DOTOMP_UB:%.*]] = alloca i32, align 4
743f90abac6SMike Rice // NORM-NEXT:    [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
744f90abac6SMike Rice // NORM-NEXT:    [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
745ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[RED3:%.*]] = alloca [[STRUCT_POINT:%.*]], align 4
746ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[I4:%.*]] = alloca i32, align 4
747f90abac6SMike Rice // NORM-NEXT:    [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [1 x i8*], align 8
748f90abac6SMike Rice // NORM-NEXT:    [[REF_TMP:%.*]] = alloca [[STRUCT_POINT]], align 4
749ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[REF_TMP10:%.*]] = alloca [[STRUCT_POINT]], align 4
750f90abac6SMike Rice // NORM-NEXT:    store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
751f90abac6SMike Rice // NORM-NEXT:    store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
752ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i32* [[N]], i32** [[N_ADDR]], align 8
753ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store %struct.Point* [[RED]], %struct.Point** [[RED_ADDR]], align 8
754ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store %struct.Point** [[POINTS]], %struct.Point*** [[POINTS_ADDR]], align 8
755ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP0:%.*]] = load i32*, i32** [[N_ADDR]], align 8
756ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP1:%.*]] = load %struct.Point*, %struct.Point** [[RED_ADDR]], align 8
757ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP2:%.*]] = load %struct.Point**, %struct.Point*** [[POINTS_ADDR]], align 8
758ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP3:%.*]] = load i32, i32* [[TMP0]], align 4
759ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i32 [[TMP3]], i32* [[DOTCAPTURE_EXPR_]], align 4
760ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP4:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_]], align 4
761ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[SUB:%.*]] = sub i32 [[TMP4]], 0
762f90abac6SMike Rice // NORM-NEXT:    [[DIV:%.*]] = udiv i32 [[SUB]], 1
763f90abac6SMike Rice // NORM-NEXT:    [[SUB2:%.*]] = sub i32 [[DIV]], 1
764f90abac6SMike Rice // NORM-NEXT:    store i32 [[SUB2]], i32* [[DOTCAPTURE_EXPR_1]], align 4
765f90abac6SMike Rice // NORM-NEXT:    store i32 0, i32* [[I]], align 4
766ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP5:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_]], align 4
767ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[CMP:%.*]] = icmp ult i32 0, [[TMP5]]
768f90abac6SMike Rice // NORM-NEXT:    br i1 [[CMP]], label [[OMP_PRECOND_THEN:%.*]], label [[OMP_PRECOND_END:%.*]]
769f90abac6SMike Rice // NORM:       omp.precond.then:
770f90abac6SMike Rice // NORM-NEXT:    store i32 0, i32* [[DOTOMP_LB]], align 4
771ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP6:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_1]], align 4
772ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i32 [[TMP6]], i32* [[DOTOMP_UB]], align 4
773f90abac6SMike Rice // NORM-NEXT:    store i32 1, i32* [[DOTOMP_STRIDE]], align 4
774f90abac6SMike Rice // NORM-NEXT:    store i32 0, i32* [[DOTOMP_IS_LAST]], align 4
775ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    call void @_ZN5PointC1Ev(%struct.Point* nonnull align 4 dereferenceable(8) [[RED3]]) #[[ATTR4]]
776ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP7:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
777ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP8:%.*]] = load i32, i32* [[TMP7]], align 4
778ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    call void @__kmpc_for_static_init_4u(%struct.ident_t* @[[GLOB1]], i32 [[TMP8]], i32 34, i32* [[DOTOMP_IS_LAST]], i32* [[DOTOMP_LB]], i32* [[DOTOMP_UB]], i32* [[DOTOMP_STRIDE]], i32 1, i32 1)
779ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP9:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
780ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP10:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_1]], align 4
781ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[CMP5:%.*]] = icmp ugt i32 [[TMP9]], [[TMP10]]
782ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    br i1 [[CMP5]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
783f90abac6SMike Rice // NORM:       cond.true:
784ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP11:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_1]], align 4
785f90abac6SMike Rice // NORM-NEXT:    br label [[COND_END:%.*]]
786f90abac6SMike Rice // NORM:       cond.false:
787ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP12:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
788f90abac6SMike Rice // NORM-NEXT:    br label [[COND_END]]
789f90abac6SMike Rice // NORM:       cond.end:
790ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[COND:%.*]] = phi i32 [ [[TMP11]], [[COND_TRUE]] ], [ [[TMP12]], [[COND_FALSE]] ]
791f90abac6SMike Rice // NORM-NEXT:    store i32 [[COND]], i32* [[DOTOMP_UB]], align 4
792ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP13:%.*]] = load i32, i32* [[DOTOMP_LB]], align 4
793ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i32 [[TMP13]], i32* [[DOTOMP_IV]], align 4
794f90abac6SMike Rice // NORM-NEXT:    br label [[OMP_INNER_FOR_COND:%.*]]
795f90abac6SMike Rice // NORM:       omp.inner.for.cond:
796ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP14:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
797ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP15:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
798ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[ADD:%.*]] = add i32 [[TMP15]], 1
799ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[CMP6:%.*]] = icmp ult i32 [[TMP14]], [[ADD]]
800ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    br i1 [[CMP6]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
801f90abac6SMike Rice // NORM:       omp.inner.for.body:
802ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP16:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
803ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[MUL:%.*]] = mul i32 [[TMP16]], 1
804ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[ADD7:%.*]] = add i32 0, [[MUL]]
805ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i32 [[ADD7]], i32* [[I4]], align 4
806ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP17:%.*]] = load i32, i32* [[I4]], align 4
807ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP18:%.*]] = load %struct.Point*, %struct.Point** [[TMP2]], align 8
808ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    call void @_Z4workR5PointiPKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[RED3]], i32 [[TMP17]], %struct.Point* [[TMP18]])
809f90abac6SMike Rice // NORM-NEXT:    br label [[OMP_BODY_CONTINUE:%.*]]
810f90abac6SMike Rice // NORM:       omp.body.continue:
811f90abac6SMike Rice // NORM-NEXT:    br label [[OMP_INNER_FOR_INC:%.*]]
812f90abac6SMike Rice // NORM:       omp.inner.for.inc:
813ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP19:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
814ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[ADD8:%.*]] = add i32 [[TMP19]], 1
815ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i32 [[ADD8]], i32* [[DOTOMP_IV]], align 4
816f90abac6SMike Rice // NORM-NEXT:    br label [[OMP_INNER_FOR_COND]]
817f90abac6SMike Rice // NORM:       omp.inner.for.end:
818f90abac6SMike Rice // NORM-NEXT:    br label [[OMP_LOOP_EXIT:%.*]]
819f90abac6SMike Rice // NORM:       omp.loop.exit:
820ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP20:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
821ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP21:%.*]] = load i32, i32* [[TMP20]], align 4
822ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    call void @__kmpc_for_static_fini(%struct.ident_t* @[[GLOB1]], i32 [[TMP21]])
823ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP22:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 0
824ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP23:%.*]] = bitcast %struct.Point* [[RED3]] to i8*
825ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i8* [[TMP23]], i8** [[TMP22]], align 8
826f90abac6SMike Rice // NORM-NEXT:    [[TMP24:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
827f90abac6SMike Rice // NORM-NEXT:    [[TMP25:%.*]] = load i32, i32* [[TMP24]], align 4
828ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP26:%.*]] = bitcast [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8*
829ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP27:%.*]] = call i32 @__kmpc_reduce_nowait(%struct.ident_t* @[[GLOB2]], i32 [[TMP25]], i32 1, i64 8, i8* [[TMP26]], void (i8*, i8*)* @.omp.reduction.reduction_func.8, [8 x i32]* @.gomp_critical_user_.reduction.var)
830ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    switch i32 [[TMP27]], label [[DOTOMP_REDUCTION_DEFAULT:%.*]] [
831f90abac6SMike Rice // NORM-NEXT:    i32 1, label [[DOTOMP_REDUCTION_CASE1:%.*]]
832f90abac6SMike Rice // NORM-NEXT:    i32 2, label [[DOTOMP_REDUCTION_CASE2:%.*]]
833f90abac6SMike Rice // NORM-NEXT:    ]
834f90abac6SMike Rice // NORM:       .omp.reduction.case1:
835ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[CALL:%.*]] = call i64 @_ZNK5PointorERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP1]], %struct.Point* nonnull align 4 dereferenceable(8) [[RED3]])
836ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP28:%.*]] = bitcast %struct.Point* [[REF_TMP]] to i64*
837ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i64 [[CALL]], i64* [[TMP28]], align 4
838ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[CALL9:%.*]] = call nonnull align 4 dereferenceable(8) %struct.Point* @_ZN5PointaSERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP1]], %struct.Point* nonnull align 4 dereferenceable(8) [[REF_TMP]])
839ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    call void @__kmpc_end_reduce_nowait(%struct.ident_t* @[[GLOB2]], i32 [[TMP25]], [8 x i32]* @.gomp_critical_user_.reduction.var)
840f90abac6SMike Rice // NORM-NEXT:    br label [[DOTOMP_REDUCTION_DEFAULT]]
841f90abac6SMike Rice // NORM:       .omp.reduction.case2:
842ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP29:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
843ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP30:%.*]] = load i32, i32* [[TMP29]], align 4
844ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    call void @__kmpc_critical(%struct.ident_t* @[[GLOB3]], i32 [[TMP30]], [8 x i32]* @.gomp_critical_user_.atomic_reduction.var)
845ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[CALL11:%.*]] = call i64 @_ZNK5PointorERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP1]], %struct.Point* nonnull align 4 dereferenceable(8) [[RED3]])
846ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP31:%.*]] = bitcast %struct.Point* [[REF_TMP10]] to i64*
847ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i64 [[CALL11]], i64* [[TMP31]], align 4
848ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[CALL12:%.*]] = call nonnull align 4 dereferenceable(8) %struct.Point* @_ZN5PointaSERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP1]], %struct.Point* nonnull align 4 dereferenceable(8) [[REF_TMP10]])
849ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    call void @__kmpc_end_critical(%struct.ident_t* @[[GLOB3]], i32 [[TMP30]], [8 x i32]* @.gomp_critical_user_.atomic_reduction.var)
850f90abac6SMike Rice // NORM-NEXT:    br label [[DOTOMP_REDUCTION_DEFAULT]]
851f90abac6SMike Rice // NORM:       .omp.reduction.default:
852f90abac6SMike Rice // NORM-NEXT:    br label [[OMP_PRECOND_END]]
853f90abac6SMike Rice // NORM:       omp.precond.end:
854f90abac6SMike Rice // NORM-NEXT:    ret void
855f90abac6SMike Rice //
856f90abac6SMike Rice //
857f90abac6SMike Rice // NORM-LABEL: define {{[^@]+}}@.omp.reduction.reduction_func.8
858f90abac6SMike Rice // NORM-SAME: (i8* [[TMP0:%.*]], i8* [[TMP1:%.*]]) #[[ATTR5]] {
859f90abac6SMike Rice // NORM-NEXT:  entry:
860f90abac6SMike Rice // NORM-NEXT:    [[DOTADDR:%.*]] = alloca i8*, align 8
861f90abac6SMike Rice // NORM-NEXT:    [[DOTADDR1:%.*]] = alloca i8*, align 8
862f90abac6SMike Rice // NORM-NEXT:    [[REF_TMP:%.*]] = alloca [[STRUCT_POINT:%.*]], align 4
863f90abac6SMike Rice // NORM-NEXT:    store i8* [[TMP0]], i8** [[DOTADDR]], align 8
864f90abac6SMike Rice // NORM-NEXT:    store i8* [[TMP1]], i8** [[DOTADDR1]], align 8
865f90abac6SMike Rice // NORM-NEXT:    [[TMP2:%.*]] = load i8*, i8** [[DOTADDR]], align 8
866f90abac6SMike Rice // NORM-NEXT:    [[TMP3:%.*]] = bitcast i8* [[TMP2]] to [1 x i8*]*
867f90abac6SMike Rice // NORM-NEXT:    [[TMP4:%.*]] = load i8*, i8** [[DOTADDR1]], align 8
868f90abac6SMike Rice // NORM-NEXT:    [[TMP5:%.*]] = bitcast i8* [[TMP4]] to [1 x i8*]*
869f90abac6SMike Rice // NORM-NEXT:    [[TMP6:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP5]], i64 0, i64 0
870f90abac6SMike Rice // NORM-NEXT:    [[TMP7:%.*]] = load i8*, i8** [[TMP6]], align 8
871f90abac6SMike Rice // NORM-NEXT:    [[TMP8:%.*]] = bitcast i8* [[TMP7]] to %struct.Point*
872f90abac6SMike Rice // NORM-NEXT:    [[TMP9:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP3]], i64 0, i64 0
873f90abac6SMike Rice // NORM-NEXT:    [[TMP10:%.*]] = load i8*, i8** [[TMP9]], align 8
874f90abac6SMike Rice // NORM-NEXT:    [[TMP11:%.*]] = bitcast i8* [[TMP10]] to %struct.Point*
87516d03818SRoman Lebedev // NORM-NEXT:    [[CALL:%.*]] = call i64 @_ZNK5PointorERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP11]], %struct.Point* nonnull align 4 dereferenceable(8) [[TMP8]])
876f90abac6SMike Rice // NORM-NEXT:    [[TMP12:%.*]] = bitcast %struct.Point* [[REF_TMP]] to i64*
877f90abac6SMike Rice // NORM-NEXT:    store i64 [[CALL]], i64* [[TMP12]], align 4
87816d03818SRoman Lebedev // NORM-NEXT:    [[CALL2:%.*]] = call nonnull align 4 dereferenceable(8) %struct.Point* @_ZN5PointaSERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP11]], %struct.Point* nonnull align 4 dereferenceable(8) [[REF_TMP]])
879f90abac6SMike Rice // NORM-NEXT:    ret void
880f90abac6SMike Rice //
881f90abac6SMike Rice //
882f90abac6SMike Rice // NORM-LABEL: define {{[^@]+}}@.omp_outlined..9
883ac90dfc4SGiorgis Georgakoudis // NORM-SAME: (i32* noalias [[DOTGLOBAL_TID_:%.*]], i32* noalias [[DOTBOUND_TID_:%.*]], i32* nonnull align 4 dereferenceable(4) [[N:%.*]], %struct.Point* nonnull align 4 dereferenceable(8) [[RED:%.*]], %struct.Point** nonnull align 8 dereferenceable(8) [[POINTS:%.*]]) #[[ATTR2]] {
884f90abac6SMike Rice // NORM-NEXT:  entry:
885f90abac6SMike Rice // NORM-NEXT:    [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
886f90abac6SMike Rice // NORM-NEXT:    [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
887ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[N_ADDR:%.*]] = alloca i32*, align 8
888ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[RED_ADDR:%.*]] = alloca %struct.Point*, align 8
889ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[POINTS_ADDR:%.*]] = alloca %struct.Point**, align 8
890f90abac6SMike Rice // NORM-NEXT:    [[DOTOMP_IV:%.*]] = alloca i32, align 4
891f90abac6SMike Rice // NORM-NEXT:    [[TMP:%.*]] = alloca i32, align 4
892f90abac6SMike Rice // NORM-NEXT:    [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
893f90abac6SMike Rice // NORM-NEXT:    [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
894f90abac6SMike Rice // NORM-NEXT:    [[I:%.*]] = alloca i32, align 4
895f90abac6SMike Rice // NORM-NEXT:    [[DOTOMP_LB:%.*]] = alloca i32, align 4
896f90abac6SMike Rice // NORM-NEXT:    [[DOTOMP_UB:%.*]] = alloca i32, align 4
897f90abac6SMike Rice // NORM-NEXT:    [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
898f90abac6SMike Rice // NORM-NEXT:    [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
899ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[RED3:%.*]] = alloca [[STRUCT_POINT:%.*]], align 4
900ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[I4:%.*]] = alloca i32, align 4
901f90abac6SMike Rice // NORM-NEXT:    [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [1 x i8*], align 8
902f90abac6SMike Rice // NORM-NEXT:    [[REF_TMP:%.*]] = alloca [[STRUCT_POINT]], align 4
903ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[REF_TMP10:%.*]] = alloca [[STRUCT_POINT]], align 4
904f90abac6SMike Rice // NORM-NEXT:    store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
905f90abac6SMike Rice // NORM-NEXT:    store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
906ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i32* [[N]], i32** [[N_ADDR]], align 8
907ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store %struct.Point* [[RED]], %struct.Point** [[RED_ADDR]], align 8
908ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store %struct.Point** [[POINTS]], %struct.Point*** [[POINTS_ADDR]], align 8
909ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP0:%.*]] = load i32*, i32** [[N_ADDR]], align 8
910ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP1:%.*]] = load %struct.Point*, %struct.Point** [[RED_ADDR]], align 8
911ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP2:%.*]] = load %struct.Point**, %struct.Point*** [[POINTS_ADDR]], align 8
912ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP3:%.*]] = load i32, i32* [[TMP0]], align 4
913ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i32 [[TMP3]], i32* [[DOTCAPTURE_EXPR_]], align 4
914ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP4:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_]], align 4
915ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[SUB:%.*]] = sub i32 [[TMP4]], 0
916f90abac6SMike Rice // NORM-NEXT:    [[DIV:%.*]] = udiv i32 [[SUB]], 1
917f90abac6SMike Rice // NORM-NEXT:    [[SUB2:%.*]] = sub i32 [[DIV]], 1
918f90abac6SMike Rice // NORM-NEXT:    store i32 [[SUB2]], i32* [[DOTCAPTURE_EXPR_1]], align 4
919f90abac6SMike Rice // NORM-NEXT:    store i32 0, i32* [[I]], align 4
920ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP5:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_]], align 4
921ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[CMP:%.*]] = icmp ult i32 0, [[TMP5]]
922f90abac6SMike Rice // NORM-NEXT:    br i1 [[CMP]], label [[OMP_PRECOND_THEN:%.*]], label [[OMP_PRECOND_END:%.*]]
923f90abac6SMike Rice // NORM:       omp.precond.then:
924f90abac6SMike Rice // NORM-NEXT:    store i32 0, i32* [[DOTOMP_LB]], align 4
925ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP6:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_1]], align 4
926ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i32 [[TMP6]], i32* [[DOTOMP_UB]], align 4
927f90abac6SMike Rice // NORM-NEXT:    store i32 1, i32* [[DOTOMP_STRIDE]], align 4
928f90abac6SMike Rice // NORM-NEXT:    store i32 0, i32* [[DOTOMP_IS_LAST]], align 4
929ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    call void @_ZN5PointC1Ev(%struct.Point* nonnull align 4 dereferenceable(8) [[RED3]]) #[[ATTR4]]
930ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP7:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
931ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP8:%.*]] = load i32, i32* [[TMP7]], align 4
932ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    call void @__kmpc_for_static_init_4u(%struct.ident_t* @[[GLOB1]], i32 [[TMP8]], i32 34, i32* [[DOTOMP_IS_LAST]], i32* [[DOTOMP_LB]], i32* [[DOTOMP_UB]], i32* [[DOTOMP_STRIDE]], i32 1, i32 1)
933ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP9:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
934ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP10:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_1]], align 4
935ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[CMP5:%.*]] = icmp ugt i32 [[TMP9]], [[TMP10]]
936ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    br i1 [[CMP5]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
937f90abac6SMike Rice // NORM:       cond.true:
938ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP11:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_1]], align 4
939f90abac6SMike Rice // NORM-NEXT:    br label [[COND_END:%.*]]
940f90abac6SMike Rice // NORM:       cond.false:
941ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP12:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
942f90abac6SMike Rice // NORM-NEXT:    br label [[COND_END]]
943f90abac6SMike Rice // NORM:       cond.end:
944ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[COND:%.*]] = phi i32 [ [[TMP11]], [[COND_TRUE]] ], [ [[TMP12]], [[COND_FALSE]] ]
945f90abac6SMike Rice // NORM-NEXT:    store i32 [[COND]], i32* [[DOTOMP_UB]], align 4
946ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP13:%.*]] = load i32, i32* [[DOTOMP_LB]], align 4
947ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i32 [[TMP13]], i32* [[DOTOMP_IV]], align 4
948f90abac6SMike Rice // NORM-NEXT:    br label [[OMP_INNER_FOR_COND:%.*]]
949f90abac6SMike Rice // NORM:       omp.inner.for.cond:
950ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP14:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
951ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP15:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
952ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[ADD:%.*]] = add i32 [[TMP15]], 1
953ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[CMP6:%.*]] = icmp ult i32 [[TMP14]], [[ADD]]
954ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    br i1 [[CMP6]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
955f90abac6SMike Rice // NORM:       omp.inner.for.body:
956ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP16:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
957ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[MUL:%.*]] = mul i32 [[TMP16]], 1
958ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[ADD7:%.*]] = add i32 0, [[MUL]]
959ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i32 [[ADD7]], i32* [[I4]], align 4
960ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP17:%.*]] = load i32, i32* [[I4]], align 4
961ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP18:%.*]] = load %struct.Point*, %struct.Point** [[TMP2]], align 8
962ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    call void @_Z4workR5PointiPKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[RED3]], i32 [[TMP17]], %struct.Point* [[TMP18]])
963f90abac6SMike Rice // NORM-NEXT:    br label [[OMP_BODY_CONTINUE:%.*]]
964f90abac6SMike Rice // NORM:       omp.body.continue:
965f90abac6SMike Rice // NORM-NEXT:    br label [[OMP_INNER_FOR_INC:%.*]]
966f90abac6SMike Rice // NORM:       omp.inner.for.inc:
967ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP19:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
968ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[ADD8:%.*]] = add i32 [[TMP19]], 1
969ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i32 [[ADD8]], i32* [[DOTOMP_IV]], align 4
970f90abac6SMike Rice // NORM-NEXT:    br label [[OMP_INNER_FOR_COND]]
971f90abac6SMike Rice // NORM:       omp.inner.for.end:
972f90abac6SMike Rice // NORM-NEXT:    br label [[OMP_LOOP_EXIT:%.*]]
973f90abac6SMike Rice // NORM:       omp.loop.exit:
974ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP20:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
975ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP21:%.*]] = load i32, i32* [[TMP20]], align 4
976ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    call void @__kmpc_for_static_fini(%struct.ident_t* @[[GLOB1]], i32 [[TMP21]])
977ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP22:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 0
978ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP23:%.*]] = bitcast %struct.Point* [[RED3]] to i8*
979ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i8* [[TMP23]], i8** [[TMP22]], align 8
980f90abac6SMike Rice // NORM-NEXT:    [[TMP24:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
981f90abac6SMike Rice // NORM-NEXT:    [[TMP25:%.*]] = load i32, i32* [[TMP24]], align 4
982ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP26:%.*]] = bitcast [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8*
983ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP27:%.*]] = call i32 @__kmpc_reduce_nowait(%struct.ident_t* @[[GLOB2]], i32 [[TMP25]], i32 1, i64 8, i8* [[TMP26]], void (i8*, i8*)* @.omp.reduction.reduction_func.10, [8 x i32]* @.gomp_critical_user_.reduction.var)
984ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    switch i32 [[TMP27]], label [[DOTOMP_REDUCTION_DEFAULT:%.*]] [
985f90abac6SMike Rice // NORM-NEXT:    i32 1, label [[DOTOMP_REDUCTION_CASE1:%.*]]
986f90abac6SMike Rice // NORM-NEXT:    i32 2, label [[DOTOMP_REDUCTION_CASE2:%.*]]
987f90abac6SMike Rice // NORM-NEXT:    ]
988f90abac6SMike Rice // NORM:       .omp.reduction.case1:
989ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[CALL:%.*]] = call i64 @_ZNK5PointeoERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP1]], %struct.Point* nonnull align 4 dereferenceable(8) [[RED3]])
990ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP28:%.*]] = bitcast %struct.Point* [[REF_TMP]] to i64*
991ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i64 [[CALL]], i64* [[TMP28]], align 4
992ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[CALL9:%.*]] = call nonnull align 4 dereferenceable(8) %struct.Point* @_ZN5PointaSERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP1]], %struct.Point* nonnull align 4 dereferenceable(8) [[REF_TMP]])
993ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    call void @__kmpc_end_reduce_nowait(%struct.ident_t* @[[GLOB2]], i32 [[TMP25]], [8 x i32]* @.gomp_critical_user_.reduction.var)
994f90abac6SMike Rice // NORM-NEXT:    br label [[DOTOMP_REDUCTION_DEFAULT]]
995f90abac6SMike Rice // NORM:       .omp.reduction.case2:
996ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP29:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
997ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP30:%.*]] = load i32, i32* [[TMP29]], align 4
998ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    call void @__kmpc_critical(%struct.ident_t* @[[GLOB3]], i32 [[TMP30]], [8 x i32]* @.gomp_critical_user_.atomic_reduction.var)
999ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[CALL11:%.*]] = call i64 @_ZNK5PointeoERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP1]], %struct.Point* nonnull align 4 dereferenceable(8) [[RED3]])
1000ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP31:%.*]] = bitcast %struct.Point* [[REF_TMP10]] to i64*
1001ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i64 [[CALL11]], i64* [[TMP31]], align 4
1002ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[CALL12:%.*]] = call nonnull align 4 dereferenceable(8) %struct.Point* @_ZN5PointaSERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP1]], %struct.Point* nonnull align 4 dereferenceable(8) [[REF_TMP10]])
1003ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    call void @__kmpc_end_critical(%struct.ident_t* @[[GLOB3]], i32 [[TMP30]], [8 x i32]* @.gomp_critical_user_.atomic_reduction.var)
1004f90abac6SMike Rice // NORM-NEXT:    br label [[DOTOMP_REDUCTION_DEFAULT]]
1005f90abac6SMike Rice // NORM:       .omp.reduction.default:
1006f90abac6SMike Rice // NORM-NEXT:    br label [[OMP_PRECOND_END]]
1007f90abac6SMike Rice // NORM:       omp.precond.end:
1008f90abac6SMike Rice // NORM-NEXT:    ret void
1009f90abac6SMike Rice //
1010f90abac6SMike Rice //
1011f90abac6SMike Rice // NORM-LABEL: define {{[^@]+}}@.omp.reduction.reduction_func.10
1012f90abac6SMike Rice // NORM-SAME: (i8* [[TMP0:%.*]], i8* [[TMP1:%.*]]) #[[ATTR5]] {
1013f90abac6SMike Rice // NORM-NEXT:  entry:
1014f90abac6SMike Rice // NORM-NEXT:    [[DOTADDR:%.*]] = alloca i8*, align 8
1015f90abac6SMike Rice // NORM-NEXT:    [[DOTADDR1:%.*]] = alloca i8*, align 8
1016f90abac6SMike Rice // NORM-NEXT:    [[REF_TMP:%.*]] = alloca [[STRUCT_POINT:%.*]], align 4
1017f90abac6SMike Rice // NORM-NEXT:    store i8* [[TMP0]], i8** [[DOTADDR]], align 8
1018f90abac6SMike Rice // NORM-NEXT:    store i8* [[TMP1]], i8** [[DOTADDR1]], align 8
1019f90abac6SMike Rice // NORM-NEXT:    [[TMP2:%.*]] = load i8*, i8** [[DOTADDR]], align 8
1020f90abac6SMike Rice // NORM-NEXT:    [[TMP3:%.*]] = bitcast i8* [[TMP2]] to [1 x i8*]*
1021f90abac6SMike Rice // NORM-NEXT:    [[TMP4:%.*]] = load i8*, i8** [[DOTADDR1]], align 8
1022f90abac6SMike Rice // NORM-NEXT:    [[TMP5:%.*]] = bitcast i8* [[TMP4]] to [1 x i8*]*
1023f90abac6SMike Rice // NORM-NEXT:    [[TMP6:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP5]], i64 0, i64 0
1024f90abac6SMike Rice // NORM-NEXT:    [[TMP7:%.*]] = load i8*, i8** [[TMP6]], align 8
1025f90abac6SMike Rice // NORM-NEXT:    [[TMP8:%.*]] = bitcast i8* [[TMP7]] to %struct.Point*
1026f90abac6SMike Rice // NORM-NEXT:    [[TMP9:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP3]], i64 0, i64 0
1027f90abac6SMike Rice // NORM-NEXT:    [[TMP10:%.*]] = load i8*, i8** [[TMP9]], align 8
1028f90abac6SMike Rice // NORM-NEXT:    [[TMP11:%.*]] = bitcast i8* [[TMP10]] to %struct.Point*
102916d03818SRoman Lebedev // NORM-NEXT:    [[CALL:%.*]] = call i64 @_ZNK5PointeoERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP11]], %struct.Point* nonnull align 4 dereferenceable(8) [[TMP8]])
1030f90abac6SMike Rice // NORM-NEXT:    [[TMP12:%.*]] = bitcast %struct.Point* [[REF_TMP]] to i64*
1031f90abac6SMike Rice // NORM-NEXT:    store i64 [[CALL]], i64* [[TMP12]], align 4
103216d03818SRoman Lebedev // NORM-NEXT:    [[CALL2:%.*]] = call nonnull align 4 dereferenceable(8) %struct.Point* @_ZN5PointaSERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP11]], %struct.Point* nonnull align 4 dereferenceable(8) [[REF_TMP]])
1033f90abac6SMike Rice // NORM-NEXT:    ret void
1034f90abac6SMike Rice //
1035f90abac6SMike Rice //
1036f90abac6SMike Rice // NORM-LABEL: define {{[^@]+}}@.omp_outlined..11
1037ac90dfc4SGiorgis Georgakoudis // NORM-SAME: (i32* noalias [[DOTGLOBAL_TID_:%.*]], i32* noalias [[DOTBOUND_TID_:%.*]], i32* nonnull align 4 dereferenceable(4) [[N:%.*]], %struct.Point* nonnull align 4 dereferenceable(8) [[RED:%.*]], %struct.Point** nonnull align 8 dereferenceable(8) [[POINTS:%.*]]) #[[ATTR2]] {
1038f90abac6SMike Rice // NORM-NEXT:  entry:
1039f90abac6SMike Rice // NORM-NEXT:    [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
1040f90abac6SMike Rice // NORM-NEXT:    [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
1041ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[N_ADDR:%.*]] = alloca i32*, align 8
1042ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[RED_ADDR:%.*]] = alloca %struct.Point*, align 8
1043ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[POINTS_ADDR:%.*]] = alloca %struct.Point**, align 8
1044f90abac6SMike Rice // NORM-NEXT:    [[DOTOMP_IV:%.*]] = alloca i32, align 4
1045f90abac6SMike Rice // NORM-NEXT:    [[TMP:%.*]] = alloca i32, align 4
1046f90abac6SMike Rice // NORM-NEXT:    [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
1047f90abac6SMike Rice // NORM-NEXT:    [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
1048f90abac6SMike Rice // NORM-NEXT:    [[I:%.*]] = alloca i32, align 4
1049f90abac6SMike Rice // NORM-NEXT:    [[DOTOMP_LB:%.*]] = alloca i32, align 4
1050f90abac6SMike Rice // NORM-NEXT:    [[DOTOMP_UB:%.*]] = alloca i32, align 4
1051f90abac6SMike Rice // NORM-NEXT:    [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1052f90abac6SMike Rice // NORM-NEXT:    [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1053ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[RED3:%.*]] = alloca [[STRUCT_POINT:%.*]], align 4
1054ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[I4:%.*]] = alloca i32, align 4
1055f90abac6SMike Rice // NORM-NEXT:    [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [1 x i8*], align 8
1056f90abac6SMike Rice // NORM-NEXT:    [[REF_TMP:%.*]] = alloca [[STRUCT_POINT]], align 4
1057ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[REF_TMP10:%.*]] = alloca [[STRUCT_POINT]], align 4
1058f90abac6SMike Rice // NORM-NEXT:    store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
1059f90abac6SMike Rice // NORM-NEXT:    store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
1060ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i32* [[N]], i32** [[N_ADDR]], align 8
1061ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store %struct.Point* [[RED]], %struct.Point** [[RED_ADDR]], align 8
1062ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store %struct.Point** [[POINTS]], %struct.Point*** [[POINTS_ADDR]], align 8
1063ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP0:%.*]] = load i32*, i32** [[N_ADDR]], align 8
1064ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP1:%.*]] = load %struct.Point*, %struct.Point** [[RED_ADDR]], align 8
1065ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP2:%.*]] = load %struct.Point**, %struct.Point*** [[POINTS_ADDR]], align 8
1066ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP3:%.*]] = load i32, i32* [[TMP0]], align 4
1067ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i32 [[TMP3]], i32* [[DOTCAPTURE_EXPR_]], align 4
1068ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP4:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_]], align 4
1069ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[SUB:%.*]] = sub i32 [[TMP4]], 0
1070f90abac6SMike Rice // NORM-NEXT:    [[DIV:%.*]] = udiv i32 [[SUB]], 1
1071f90abac6SMike Rice // NORM-NEXT:    [[SUB2:%.*]] = sub i32 [[DIV]], 1
1072f90abac6SMike Rice // NORM-NEXT:    store i32 [[SUB2]], i32* [[DOTCAPTURE_EXPR_1]], align 4
1073f90abac6SMike Rice // NORM-NEXT:    store i32 0, i32* [[I]], align 4
1074ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP5:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_]], align 4
1075ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[CMP:%.*]] = icmp ult i32 0, [[TMP5]]
1076f90abac6SMike Rice // NORM-NEXT:    br i1 [[CMP]], label [[OMP_PRECOND_THEN:%.*]], label [[OMP_PRECOND_END:%.*]]
1077f90abac6SMike Rice // NORM:       omp.precond.then:
1078f90abac6SMike Rice // NORM-NEXT:    store i32 0, i32* [[DOTOMP_LB]], align 4
1079ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP6:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_1]], align 4
1080ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i32 [[TMP6]], i32* [[DOTOMP_UB]], align 4
1081f90abac6SMike Rice // NORM-NEXT:    store i32 1, i32* [[DOTOMP_STRIDE]], align 4
1082f90abac6SMike Rice // NORM-NEXT:    store i32 0, i32* [[DOTOMP_IS_LAST]], align 4
1083ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    call void @_ZN5PointC1Ev(%struct.Point* nonnull align 4 dereferenceable(8) [[RED3]]) #[[ATTR4]]
1084ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP7:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
1085ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP8:%.*]] = load i32, i32* [[TMP7]], align 4
1086ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    call void @__kmpc_for_static_init_4u(%struct.ident_t* @[[GLOB1]], i32 [[TMP8]], i32 34, i32* [[DOTOMP_IS_LAST]], i32* [[DOTOMP_LB]], i32* [[DOTOMP_UB]], i32* [[DOTOMP_STRIDE]], i32 1, i32 1)
1087ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP9:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
1088ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP10:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_1]], align 4
1089ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[CMP5:%.*]] = icmp ugt i32 [[TMP9]], [[TMP10]]
1090ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    br i1 [[CMP5]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1091f90abac6SMike Rice // NORM:       cond.true:
1092ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP11:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_1]], align 4
1093f90abac6SMike Rice // NORM-NEXT:    br label [[COND_END:%.*]]
1094f90abac6SMike Rice // NORM:       cond.false:
1095ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP12:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
1096f90abac6SMike Rice // NORM-NEXT:    br label [[COND_END]]
1097f90abac6SMike Rice // NORM:       cond.end:
1098ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[COND:%.*]] = phi i32 [ [[TMP11]], [[COND_TRUE]] ], [ [[TMP12]], [[COND_FALSE]] ]
1099f90abac6SMike Rice // NORM-NEXT:    store i32 [[COND]], i32* [[DOTOMP_UB]], align 4
1100ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP13:%.*]] = load i32, i32* [[DOTOMP_LB]], align 4
1101ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i32 [[TMP13]], i32* [[DOTOMP_IV]], align 4
1102f90abac6SMike Rice // NORM-NEXT:    br label [[OMP_INNER_FOR_COND:%.*]]
1103f90abac6SMike Rice // NORM:       omp.inner.for.cond:
1104ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP14:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
1105ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP15:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
1106ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[ADD:%.*]] = add i32 [[TMP15]], 1
1107ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[CMP6:%.*]] = icmp ult i32 [[TMP14]], [[ADD]]
1108ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    br i1 [[CMP6]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1109f90abac6SMike Rice // NORM:       omp.inner.for.body:
1110ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP16:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
1111ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[MUL:%.*]] = mul i32 [[TMP16]], 1
1112ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[ADD7:%.*]] = add i32 0, [[MUL]]
1113ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i32 [[ADD7]], i32* [[I4]], align 4
1114ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP17:%.*]] = load i32, i32* [[I4]], align 4
1115ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP18:%.*]] = load %struct.Point*, %struct.Point** [[TMP2]], align 8
1116ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    call void @_Z4workR5PointiPKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[RED3]], i32 [[TMP17]], %struct.Point* [[TMP18]])
1117f90abac6SMike Rice // NORM-NEXT:    br label [[OMP_BODY_CONTINUE:%.*]]
1118f90abac6SMike Rice // NORM:       omp.body.continue:
1119f90abac6SMike Rice // NORM-NEXT:    br label [[OMP_INNER_FOR_INC:%.*]]
1120f90abac6SMike Rice // NORM:       omp.inner.for.inc:
1121ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP19:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
1122ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[ADD8:%.*]] = add i32 [[TMP19]], 1
1123ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i32 [[ADD8]], i32* [[DOTOMP_IV]], align 4
1124f90abac6SMike Rice // NORM-NEXT:    br label [[OMP_INNER_FOR_COND]]
1125f90abac6SMike Rice // NORM:       omp.inner.for.end:
1126f90abac6SMike Rice // NORM-NEXT:    br label [[OMP_LOOP_EXIT:%.*]]
1127f90abac6SMike Rice // NORM:       omp.loop.exit:
1128ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP20:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
1129ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP21:%.*]] = load i32, i32* [[TMP20]], align 4
1130ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    call void @__kmpc_for_static_fini(%struct.ident_t* @[[GLOB1]], i32 [[TMP21]])
1131ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP22:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 0
1132ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP23:%.*]] = bitcast %struct.Point* [[RED3]] to i8*
1133ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i8* [[TMP23]], i8** [[TMP22]], align 8
1134f90abac6SMike Rice // NORM-NEXT:    [[TMP24:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
1135f90abac6SMike Rice // NORM-NEXT:    [[TMP25:%.*]] = load i32, i32* [[TMP24]], align 4
1136ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP26:%.*]] = bitcast [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8*
1137ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP27:%.*]] = call i32 @__kmpc_reduce_nowait(%struct.ident_t* @[[GLOB2]], i32 [[TMP25]], i32 1, i64 8, i8* [[TMP26]], void (i8*, i8*)* @.omp.reduction.reduction_func.12, [8 x i32]* @.gomp_critical_user_.reduction.var)
1138ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    switch i32 [[TMP27]], label [[DOTOMP_REDUCTION_DEFAULT:%.*]] [
1139f90abac6SMike Rice // NORM-NEXT:    i32 1, label [[DOTOMP_REDUCTION_CASE1:%.*]]
1140f90abac6SMike Rice // NORM-NEXT:    i32 2, label [[DOTOMP_REDUCTION_CASE2:%.*]]
1141f90abac6SMike Rice // NORM-NEXT:    ]
1142f90abac6SMike Rice // NORM:       .omp.reduction.case1:
1143ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[CALL:%.*]] = call i64 @_ZNK5PointaaERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP1]], %struct.Point* nonnull align 4 dereferenceable(8) [[RED3]])
1144ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP28:%.*]] = bitcast %struct.Point* [[REF_TMP]] to i64*
1145ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i64 [[CALL]], i64* [[TMP28]], align 4
1146ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[CALL9:%.*]] = call nonnull align 4 dereferenceable(8) %struct.Point* @_ZN5PointaSERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP1]], %struct.Point* nonnull align 4 dereferenceable(8) [[REF_TMP]])
1147ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    call void @__kmpc_end_reduce_nowait(%struct.ident_t* @[[GLOB2]], i32 [[TMP25]], [8 x i32]* @.gomp_critical_user_.reduction.var)
1148f90abac6SMike Rice // NORM-NEXT:    br label [[DOTOMP_REDUCTION_DEFAULT]]
1149f90abac6SMike Rice // NORM:       .omp.reduction.case2:
1150ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP29:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
1151ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP30:%.*]] = load i32, i32* [[TMP29]], align 4
1152ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    call void @__kmpc_critical(%struct.ident_t* @[[GLOB3]], i32 [[TMP30]], [8 x i32]* @.gomp_critical_user_.atomic_reduction.var)
1153ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[CALL11:%.*]] = call i64 @_ZNK5PointaaERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP1]], %struct.Point* nonnull align 4 dereferenceable(8) [[RED3]])
1154ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP31:%.*]] = bitcast %struct.Point* [[REF_TMP10]] to i64*
1155ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i64 [[CALL11]], i64* [[TMP31]], align 4
1156ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[CALL12:%.*]] = call nonnull align 4 dereferenceable(8) %struct.Point* @_ZN5PointaSERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP1]], %struct.Point* nonnull align 4 dereferenceable(8) [[REF_TMP10]])
1157ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    call void @__kmpc_end_critical(%struct.ident_t* @[[GLOB3]], i32 [[TMP30]], [8 x i32]* @.gomp_critical_user_.atomic_reduction.var)
1158f90abac6SMike Rice // NORM-NEXT:    br label [[DOTOMP_REDUCTION_DEFAULT]]
1159f90abac6SMike Rice // NORM:       .omp.reduction.default:
1160f90abac6SMike Rice // NORM-NEXT:    br label [[OMP_PRECOND_END]]
1161f90abac6SMike Rice // NORM:       omp.precond.end:
1162f90abac6SMike Rice // NORM-NEXT:    ret void
1163f90abac6SMike Rice //
1164f90abac6SMike Rice //
1165f90abac6SMike Rice // NORM-LABEL: define {{[^@]+}}@.omp.reduction.reduction_func.12
1166f90abac6SMike Rice // NORM-SAME: (i8* [[TMP0:%.*]], i8* [[TMP1:%.*]]) #[[ATTR5]] {
1167f90abac6SMike Rice // NORM-NEXT:  entry:
1168f90abac6SMike Rice // NORM-NEXT:    [[DOTADDR:%.*]] = alloca i8*, align 8
1169f90abac6SMike Rice // NORM-NEXT:    [[DOTADDR1:%.*]] = alloca i8*, align 8
1170f90abac6SMike Rice // NORM-NEXT:    [[REF_TMP:%.*]] = alloca [[STRUCT_POINT:%.*]], align 4
1171f90abac6SMike Rice // NORM-NEXT:    store i8* [[TMP0]], i8** [[DOTADDR]], align 8
1172f90abac6SMike Rice // NORM-NEXT:    store i8* [[TMP1]], i8** [[DOTADDR1]], align 8
1173f90abac6SMike Rice // NORM-NEXT:    [[TMP2:%.*]] = load i8*, i8** [[DOTADDR]], align 8
1174f90abac6SMike Rice // NORM-NEXT:    [[TMP3:%.*]] = bitcast i8* [[TMP2]] to [1 x i8*]*
1175f90abac6SMike Rice // NORM-NEXT:    [[TMP4:%.*]] = load i8*, i8** [[DOTADDR1]], align 8
1176f90abac6SMike Rice // NORM-NEXT:    [[TMP5:%.*]] = bitcast i8* [[TMP4]] to [1 x i8*]*
1177f90abac6SMike Rice // NORM-NEXT:    [[TMP6:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP5]], i64 0, i64 0
1178f90abac6SMike Rice // NORM-NEXT:    [[TMP7:%.*]] = load i8*, i8** [[TMP6]], align 8
1179f90abac6SMike Rice // NORM-NEXT:    [[TMP8:%.*]] = bitcast i8* [[TMP7]] to %struct.Point*
1180f90abac6SMike Rice // NORM-NEXT:    [[TMP9:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP3]], i64 0, i64 0
1181f90abac6SMike Rice // NORM-NEXT:    [[TMP10:%.*]] = load i8*, i8** [[TMP9]], align 8
1182f90abac6SMike Rice // NORM-NEXT:    [[TMP11:%.*]] = bitcast i8* [[TMP10]] to %struct.Point*
118316d03818SRoman Lebedev // NORM-NEXT:    [[CALL:%.*]] = call i64 @_ZNK5PointaaERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP11]], %struct.Point* nonnull align 4 dereferenceable(8) [[TMP8]])
1184f90abac6SMike Rice // NORM-NEXT:    [[TMP12:%.*]] = bitcast %struct.Point* [[REF_TMP]] to i64*
1185f90abac6SMike Rice // NORM-NEXT:    store i64 [[CALL]], i64* [[TMP12]], align 4
118616d03818SRoman Lebedev // NORM-NEXT:    [[CALL2:%.*]] = call nonnull align 4 dereferenceable(8) %struct.Point* @_ZN5PointaSERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP11]], %struct.Point* nonnull align 4 dereferenceable(8) [[REF_TMP]])
1187f90abac6SMike Rice // NORM-NEXT:    ret void
1188f90abac6SMike Rice //
1189f90abac6SMike Rice //
1190f90abac6SMike Rice // NORM-LABEL: define {{[^@]+}}@.omp_outlined..13
1191ac90dfc4SGiorgis Georgakoudis // NORM-SAME: (i32* noalias [[DOTGLOBAL_TID_:%.*]], i32* noalias [[DOTBOUND_TID_:%.*]], i32* nonnull align 4 dereferenceable(4) [[N:%.*]], %struct.Point* nonnull align 4 dereferenceable(8) [[RED:%.*]], %struct.Point** nonnull align 8 dereferenceable(8) [[POINTS:%.*]]) #[[ATTR2]] {
1192f90abac6SMike Rice // NORM-NEXT:  entry:
1193f90abac6SMike Rice // NORM-NEXT:    [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
1194f90abac6SMike Rice // NORM-NEXT:    [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
1195ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[N_ADDR:%.*]] = alloca i32*, align 8
1196ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[RED_ADDR:%.*]] = alloca %struct.Point*, align 8
1197ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[POINTS_ADDR:%.*]] = alloca %struct.Point**, align 8
1198f90abac6SMike Rice // NORM-NEXT:    [[DOTOMP_IV:%.*]] = alloca i32, align 4
1199f90abac6SMike Rice // NORM-NEXT:    [[TMP:%.*]] = alloca i32, align 4
1200f90abac6SMike Rice // NORM-NEXT:    [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
1201f90abac6SMike Rice // NORM-NEXT:    [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
1202f90abac6SMike Rice // NORM-NEXT:    [[I:%.*]] = alloca i32, align 4
1203f90abac6SMike Rice // NORM-NEXT:    [[DOTOMP_LB:%.*]] = alloca i32, align 4
1204f90abac6SMike Rice // NORM-NEXT:    [[DOTOMP_UB:%.*]] = alloca i32, align 4
1205f90abac6SMike Rice // NORM-NEXT:    [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1206f90abac6SMike Rice // NORM-NEXT:    [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1207ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[RED3:%.*]] = alloca [[STRUCT_POINT:%.*]], align 4
1208ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[I4:%.*]] = alloca i32, align 4
1209f90abac6SMike Rice // NORM-NEXT:    [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [1 x i8*], align 8
1210f90abac6SMike Rice // NORM-NEXT:    [[REF_TMP:%.*]] = alloca [[STRUCT_POINT]], align 4
1211ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[REF_TMP10:%.*]] = alloca [[STRUCT_POINT]], align 4
1212f90abac6SMike Rice // NORM-NEXT:    store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
1213f90abac6SMike Rice // NORM-NEXT:    store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
1214ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i32* [[N]], i32** [[N_ADDR]], align 8
1215ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store %struct.Point* [[RED]], %struct.Point** [[RED_ADDR]], align 8
1216ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store %struct.Point** [[POINTS]], %struct.Point*** [[POINTS_ADDR]], align 8
1217ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP0:%.*]] = load i32*, i32** [[N_ADDR]], align 8
1218ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP1:%.*]] = load %struct.Point*, %struct.Point** [[RED_ADDR]], align 8
1219ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP2:%.*]] = load %struct.Point**, %struct.Point*** [[POINTS_ADDR]], align 8
1220ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP3:%.*]] = load i32, i32* [[TMP0]], align 4
1221ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i32 [[TMP3]], i32* [[DOTCAPTURE_EXPR_]], align 4
1222ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP4:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_]], align 4
1223ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[SUB:%.*]] = sub i32 [[TMP4]], 0
1224f90abac6SMike Rice // NORM-NEXT:    [[DIV:%.*]] = udiv i32 [[SUB]], 1
1225f90abac6SMike Rice // NORM-NEXT:    [[SUB2:%.*]] = sub i32 [[DIV]], 1
1226f90abac6SMike Rice // NORM-NEXT:    store i32 [[SUB2]], i32* [[DOTCAPTURE_EXPR_1]], align 4
1227f90abac6SMike Rice // NORM-NEXT:    store i32 0, i32* [[I]], align 4
1228ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP5:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_]], align 4
1229ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[CMP:%.*]] = icmp ult i32 0, [[TMP5]]
1230f90abac6SMike Rice // NORM-NEXT:    br i1 [[CMP]], label [[OMP_PRECOND_THEN:%.*]], label [[OMP_PRECOND_END:%.*]]
1231f90abac6SMike Rice // NORM:       omp.precond.then:
1232f90abac6SMike Rice // NORM-NEXT:    store i32 0, i32* [[DOTOMP_LB]], align 4
1233ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP6:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_1]], align 4
1234ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i32 [[TMP6]], i32* [[DOTOMP_UB]], align 4
1235f90abac6SMike Rice // NORM-NEXT:    store i32 1, i32* [[DOTOMP_STRIDE]], align 4
1236f90abac6SMike Rice // NORM-NEXT:    store i32 0, i32* [[DOTOMP_IS_LAST]], align 4
1237ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    call void @_ZN5PointC1Ev(%struct.Point* nonnull align 4 dereferenceable(8) [[RED3]]) #[[ATTR4]]
1238ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP7:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
1239ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP8:%.*]] = load i32, i32* [[TMP7]], align 4
1240ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    call void @__kmpc_for_static_init_4u(%struct.ident_t* @[[GLOB1]], i32 [[TMP8]], i32 34, i32* [[DOTOMP_IS_LAST]], i32* [[DOTOMP_LB]], i32* [[DOTOMP_UB]], i32* [[DOTOMP_STRIDE]], i32 1, i32 1)
1241ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP9:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
1242ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP10:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_1]], align 4
1243ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[CMP5:%.*]] = icmp ugt i32 [[TMP9]], [[TMP10]]
1244ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    br i1 [[CMP5]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1245f90abac6SMike Rice // NORM:       cond.true:
1246ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP11:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_1]], align 4
1247f90abac6SMike Rice // NORM-NEXT:    br label [[COND_END:%.*]]
1248f90abac6SMike Rice // NORM:       cond.false:
1249ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP12:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
1250f90abac6SMike Rice // NORM-NEXT:    br label [[COND_END]]
1251f90abac6SMike Rice // NORM:       cond.end:
1252ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[COND:%.*]] = phi i32 [ [[TMP11]], [[COND_TRUE]] ], [ [[TMP12]], [[COND_FALSE]] ]
1253f90abac6SMike Rice // NORM-NEXT:    store i32 [[COND]], i32* [[DOTOMP_UB]], align 4
1254ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP13:%.*]] = load i32, i32* [[DOTOMP_LB]], align 4
1255ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i32 [[TMP13]], i32* [[DOTOMP_IV]], align 4
1256f90abac6SMike Rice // NORM-NEXT:    br label [[OMP_INNER_FOR_COND:%.*]]
1257f90abac6SMike Rice // NORM:       omp.inner.for.cond:
1258ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP14:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
1259ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP15:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
1260ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[ADD:%.*]] = add i32 [[TMP15]], 1
1261ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[CMP6:%.*]] = icmp ult i32 [[TMP14]], [[ADD]]
1262ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    br i1 [[CMP6]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1263f90abac6SMike Rice // NORM:       omp.inner.for.body:
1264ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP16:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
1265ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[MUL:%.*]] = mul i32 [[TMP16]], 1
1266ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[ADD7:%.*]] = add i32 0, [[MUL]]
1267ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i32 [[ADD7]], i32* [[I4]], align 4
1268ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP17:%.*]] = load i32, i32* [[I4]], align 4
1269ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP18:%.*]] = load %struct.Point*, %struct.Point** [[TMP2]], align 8
1270ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    call void @_Z4workR5PointiPKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[RED3]], i32 [[TMP17]], %struct.Point* [[TMP18]])
1271f90abac6SMike Rice // NORM-NEXT:    br label [[OMP_BODY_CONTINUE:%.*]]
1272f90abac6SMike Rice // NORM:       omp.body.continue:
1273f90abac6SMike Rice // NORM-NEXT:    br label [[OMP_INNER_FOR_INC:%.*]]
1274f90abac6SMike Rice // NORM:       omp.inner.for.inc:
1275ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP19:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
1276ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[ADD8:%.*]] = add i32 [[TMP19]], 1
1277ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i32 [[ADD8]], i32* [[DOTOMP_IV]], align 4
1278f90abac6SMike Rice // NORM-NEXT:    br label [[OMP_INNER_FOR_COND]]
1279f90abac6SMike Rice // NORM:       omp.inner.for.end:
1280f90abac6SMike Rice // NORM-NEXT:    br label [[OMP_LOOP_EXIT:%.*]]
1281f90abac6SMike Rice // NORM:       omp.loop.exit:
1282ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP20:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
1283ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP21:%.*]] = load i32, i32* [[TMP20]], align 4
1284ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    call void @__kmpc_for_static_fini(%struct.ident_t* @[[GLOB1]], i32 [[TMP21]])
1285ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP22:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 0
1286ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP23:%.*]] = bitcast %struct.Point* [[RED3]] to i8*
1287ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i8* [[TMP23]], i8** [[TMP22]], align 8
1288f90abac6SMike Rice // NORM-NEXT:    [[TMP24:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
1289f90abac6SMike Rice // NORM-NEXT:    [[TMP25:%.*]] = load i32, i32* [[TMP24]], align 4
1290ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP26:%.*]] = bitcast [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8*
1291ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP27:%.*]] = call i32 @__kmpc_reduce_nowait(%struct.ident_t* @[[GLOB2]], i32 [[TMP25]], i32 1, i64 8, i8* [[TMP26]], void (i8*, i8*)* @.omp.reduction.reduction_func.14, [8 x i32]* @.gomp_critical_user_.reduction.var)
1292ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    switch i32 [[TMP27]], label [[DOTOMP_REDUCTION_DEFAULT:%.*]] [
1293f90abac6SMike Rice // NORM-NEXT:    i32 1, label [[DOTOMP_REDUCTION_CASE1:%.*]]
1294f90abac6SMike Rice // NORM-NEXT:    i32 2, label [[DOTOMP_REDUCTION_CASE2:%.*]]
1295f90abac6SMike Rice // NORM-NEXT:    ]
1296f90abac6SMike Rice // NORM:       .omp.reduction.case1:
1297ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[CALL:%.*]] = call i64 @_ZNK5PointooERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP1]], %struct.Point* nonnull align 4 dereferenceable(8) [[RED3]])
1298ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP28:%.*]] = bitcast %struct.Point* [[REF_TMP]] to i64*
1299ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i64 [[CALL]], i64* [[TMP28]], align 4
1300ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[CALL9:%.*]] = call nonnull align 4 dereferenceable(8) %struct.Point* @_ZN5PointaSERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP1]], %struct.Point* nonnull align 4 dereferenceable(8) [[REF_TMP]])
1301ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    call void @__kmpc_end_reduce_nowait(%struct.ident_t* @[[GLOB2]], i32 [[TMP25]], [8 x i32]* @.gomp_critical_user_.reduction.var)
1302f90abac6SMike Rice // NORM-NEXT:    br label [[DOTOMP_REDUCTION_DEFAULT]]
1303f90abac6SMike Rice // NORM:       .omp.reduction.case2:
1304ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP29:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
1305ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP30:%.*]] = load i32, i32* [[TMP29]], align 4
1306ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    call void @__kmpc_critical(%struct.ident_t* @[[GLOB3]], i32 [[TMP30]], [8 x i32]* @.gomp_critical_user_.atomic_reduction.var)
1307ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[CALL11:%.*]] = call i64 @_ZNK5PointooERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP1]], %struct.Point* nonnull align 4 dereferenceable(8) [[RED3]])
1308ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[TMP31:%.*]] = bitcast %struct.Point* [[REF_TMP10]] to i64*
1309ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    store i64 [[CALL11]], i64* [[TMP31]], align 4
1310ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    [[CALL12:%.*]] = call nonnull align 4 dereferenceable(8) %struct.Point* @_ZN5PointaSERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP1]], %struct.Point* nonnull align 4 dereferenceable(8) [[REF_TMP10]])
1311ac90dfc4SGiorgis Georgakoudis // NORM-NEXT:    call void @__kmpc_end_critical(%struct.ident_t* @[[GLOB3]], i32 [[TMP30]], [8 x i32]* @.gomp_critical_user_.atomic_reduction.var)
1312f90abac6SMike Rice // NORM-NEXT:    br label [[DOTOMP_REDUCTION_DEFAULT]]
1313f90abac6SMike Rice // NORM:       .omp.reduction.default:
1314f90abac6SMike Rice // NORM-NEXT:    br label [[OMP_PRECOND_END]]
1315f90abac6SMike Rice // NORM:       omp.precond.end:
1316f90abac6SMike Rice // NORM-NEXT:    ret void
1317f90abac6SMike Rice //
1318f90abac6SMike Rice //
1319f90abac6SMike Rice // NORM-LABEL: define {{[^@]+}}@.omp.reduction.reduction_func.14
1320f90abac6SMike Rice // NORM-SAME: (i8* [[TMP0:%.*]], i8* [[TMP1:%.*]]) #[[ATTR5]] {
1321f90abac6SMike Rice // NORM-NEXT:  entry:
1322f90abac6SMike Rice // NORM-NEXT:    [[DOTADDR:%.*]] = alloca i8*, align 8
1323f90abac6SMike Rice // NORM-NEXT:    [[DOTADDR1:%.*]] = alloca i8*, align 8
1324f90abac6SMike Rice // NORM-NEXT:    [[REF_TMP:%.*]] = alloca [[STRUCT_POINT:%.*]], align 4
1325f90abac6SMike Rice // NORM-NEXT:    store i8* [[TMP0]], i8** [[DOTADDR]], align 8
1326f90abac6SMike Rice // NORM-NEXT:    store i8* [[TMP1]], i8** [[DOTADDR1]], align 8
1327f90abac6SMike Rice // NORM-NEXT:    [[TMP2:%.*]] = load i8*, i8** [[DOTADDR]], align 8
1328f90abac6SMike Rice // NORM-NEXT:    [[TMP3:%.*]] = bitcast i8* [[TMP2]] to [1 x i8*]*
1329f90abac6SMike Rice // NORM-NEXT:    [[TMP4:%.*]] = load i8*, i8** [[DOTADDR1]], align 8
1330f90abac6SMike Rice // NORM-NEXT:    [[TMP5:%.*]] = bitcast i8* [[TMP4]] to [1 x i8*]*
1331f90abac6SMike Rice // NORM-NEXT:    [[TMP6:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP5]], i64 0, i64 0
1332f90abac6SMike Rice // NORM-NEXT:    [[TMP7:%.*]] = load i8*, i8** [[TMP6]], align 8
1333f90abac6SMike Rice // NORM-NEXT:    [[TMP8:%.*]] = bitcast i8* [[TMP7]] to %struct.Point*
1334f90abac6SMike Rice // NORM-NEXT:    [[TMP9:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP3]], i64 0, i64 0
1335f90abac6SMike Rice // NORM-NEXT:    [[TMP10:%.*]] = load i8*, i8** [[TMP9]], align 8
1336f90abac6SMike Rice // NORM-NEXT:    [[TMP11:%.*]] = bitcast i8* [[TMP10]] to %struct.Point*
133716d03818SRoman Lebedev // NORM-NEXT:    [[CALL:%.*]] = call i64 @_ZNK5PointooERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP11]], %struct.Point* nonnull align 4 dereferenceable(8) [[TMP8]])
1338f90abac6SMike Rice // NORM-NEXT:    [[TMP12:%.*]] = bitcast %struct.Point* [[REF_TMP]] to i64*
1339f90abac6SMike Rice // NORM-NEXT:    store i64 [[CALL]], i64* [[TMP12]], align 4
134016d03818SRoman Lebedev // NORM-NEXT:    [[CALL2:%.*]] = call nonnull align 4 dereferenceable(8) %struct.Point* @_ZN5PointaSERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP11]], %struct.Point* nonnull align 4 dereferenceable(8) [[REF_TMP]])
1341f90abac6SMike Rice // NORM-NEXT:    ret void
1342f90abac6SMike Rice //
1343f90abac6SMike Rice //
1344f90abac6SMike Rice // NORM-LABEL: define {{[^@]+}}@_ZN5PointC2Ev
134516d03818SRoman Lebedev // NORM-SAME: (%struct.Point* nonnull align 4 dereferenceable(8) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
1346f90abac6SMike Rice // NORM-NEXT:  entry:
1347f90abac6SMike Rice // NORM-NEXT:    [[THIS_ADDR:%.*]] = alloca %struct.Point*, align 8
1348f90abac6SMike Rice // NORM-NEXT:    store %struct.Point* [[THIS]], %struct.Point** [[THIS_ADDR]], align 8
1349f90abac6SMike Rice // NORM-NEXT:    [[THIS1:%.*]] = load %struct.Point*, %struct.Point** [[THIS_ADDR]], align 8
1350f90abac6SMike Rice // NORM-NEXT:    [[X:%.*]] = getelementptr inbounds [[STRUCT_POINT:%.*]], %struct.Point* [[THIS1]], i32 0, i32 0
1351f90abac6SMike Rice // NORM-NEXT:    store i32 0, i32* [[X]], align 4
1352f90abac6SMike Rice // NORM-NEXT:    [[Y:%.*]] = getelementptr inbounds [[STRUCT_POINT]], %struct.Point* [[THIS1]], i32 0, i32 1
1353f90abac6SMike Rice // NORM-NEXT:    store i32 0, i32* [[Y]], align 4
1354f90abac6SMike Rice // NORM-NEXT:    ret void
1355f90abac6SMike Rice //
1356f90abac6SMike Rice //
1357f90abac6SMike Rice // COMP-LABEL: define {{[^@]+}}@_Z3fooiPK5Point
1358f90abac6SMike Rice // COMP-SAME: (i32 [[N:%.*]], %struct.Point* [[POINTS:%.*]]) #[[ATTR0:[0-9]+]] {
1359f90abac6SMike Rice // COMP-NEXT:  entry:
1360f90abac6SMike Rice // COMP-NEXT:    [[N_ADDR:%.*]] = alloca i32, align 4
1361f90abac6SMike Rice // COMP-NEXT:    [[POINTS_ADDR:%.*]] = alloca %struct.Point*, align 8
1362f90abac6SMike Rice // COMP-NEXT:    [[RED:%.*]] = alloca [[STRUCT_POINT:%.*]], align 4
1363f90abac6SMike Rice // COMP-NEXT:    store i32 [[N]], i32* [[N_ADDR]], align 4
1364f90abac6SMike Rice // COMP-NEXT:    store %struct.Point* [[POINTS]], %struct.Point** [[POINTS_ADDR]], align 8
136516d03818SRoman Lebedev // COMP-NEXT:    call void @_ZN5PointC1Ev(%struct.Point* nonnull align 4 dereferenceable(8) [[RED]]) #[[ATTR4:[0-9]+]]
1366ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB3:[0-9]+]], i32 3, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i32*, %struct.Point*, %struct.Point**)* @.omp_outlined. to void (i32*, i32*, ...)*), i32* [[N_ADDR]], %struct.Point* [[RED]], %struct.Point** [[POINTS_ADDR]])
1367ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB3]], i32 3, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i32*, %struct.Point*, %struct.Point**)* @.omp_outlined..1 to void (i32*, i32*, ...)*), i32* [[N_ADDR]], %struct.Point* [[RED]], %struct.Point** [[POINTS_ADDR]])
1368ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB3]], i32 3, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i32*, %struct.Point*, %struct.Point**)* @.omp_outlined..3 to void (i32*, i32*, ...)*), i32* [[N_ADDR]], %struct.Point* [[RED]], %struct.Point** [[POINTS_ADDR]])
1369ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB3]], i32 3, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i32*, %struct.Point*, %struct.Point**)* @.omp_outlined..5 to void (i32*, i32*, ...)*), i32* [[N_ADDR]], %struct.Point* [[RED]], %struct.Point** [[POINTS_ADDR]])
1370ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB3]], i32 3, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i32*, %struct.Point*, %struct.Point**)* @.omp_outlined..7 to void (i32*, i32*, ...)*), i32* [[N_ADDR]], %struct.Point* [[RED]], %struct.Point** [[POINTS_ADDR]])
1371ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB3]], i32 3, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i32*, %struct.Point*, %struct.Point**)* @.omp_outlined..9 to void (i32*, i32*, ...)*), i32* [[N_ADDR]], %struct.Point* [[RED]], %struct.Point** [[POINTS_ADDR]])
1372ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB3]], i32 3, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i32*, %struct.Point*, %struct.Point**)* @.omp_outlined..11 to void (i32*, i32*, ...)*), i32* [[N_ADDR]], %struct.Point* [[RED]], %struct.Point** [[POINTS_ADDR]])
1373ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB3]], i32 3, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i32*, %struct.Point*, %struct.Point**)* @.omp_outlined..13 to void (i32*, i32*, ...)*), i32* [[N_ADDR]], %struct.Point* [[RED]], %struct.Point** [[POINTS_ADDR]])
1374f90abac6SMike Rice // COMP-NEXT:    ret void
1375f90abac6SMike Rice //
1376f90abac6SMike Rice //
1377f90abac6SMike Rice // COMP-LABEL: define {{[^@]+}}@_ZN5PointC1Ev
137816d03818SRoman Lebedev // COMP-SAME: (%struct.Point* nonnull align 4 dereferenceable(8) [[THIS:%.*]]) unnamed_addr #[[ATTR1:[0-9]+]] comdat align 2 {
1379f90abac6SMike Rice // COMP-NEXT:  entry:
1380f90abac6SMike Rice // COMP-NEXT:    [[THIS_ADDR:%.*]] = alloca %struct.Point*, align 8
1381f90abac6SMike Rice // COMP-NEXT:    store %struct.Point* [[THIS]], %struct.Point** [[THIS_ADDR]], align 8
1382f90abac6SMike Rice // COMP-NEXT:    [[THIS1:%.*]] = load %struct.Point*, %struct.Point** [[THIS_ADDR]], align 8
138316d03818SRoman Lebedev // COMP-NEXT:    call void @_ZN5PointC2Ev(%struct.Point* nonnull align 4 dereferenceable(8) [[THIS1]]) #[[ATTR4]]
1384f90abac6SMike Rice // COMP-NEXT:    ret void
1385f90abac6SMike Rice //
1386f90abac6SMike Rice //
1387f90abac6SMike Rice // COMP-LABEL: define {{[^@]+}}@.omp_outlined.
1388ac90dfc4SGiorgis Georgakoudis // COMP-SAME: (i32* noalias [[DOTGLOBAL_TID_:%.*]], i32* noalias [[DOTBOUND_TID_:%.*]], i32* nonnull align 4 dereferenceable(4) [[N:%.*]], %struct.Point* nonnull align 4 dereferenceable(8) [[RED:%.*]], %struct.Point** nonnull align 8 dereferenceable(8) [[POINTS:%.*]]) #[[ATTR2:[0-9]+]] {
1389f90abac6SMike Rice // COMP-NEXT:  entry:
1390f90abac6SMike Rice // COMP-NEXT:    [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
1391f90abac6SMike Rice // COMP-NEXT:    [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
1392ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[N_ADDR:%.*]] = alloca i32*, align 8
1393ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[RED_ADDR:%.*]] = alloca %struct.Point*, align 8
1394ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[POINTS_ADDR:%.*]] = alloca %struct.Point**, align 8
1395f90abac6SMike Rice // COMP-NEXT:    [[DOTOMP_IV:%.*]] = alloca i32, align 4
1396f90abac6SMike Rice // COMP-NEXT:    [[TMP:%.*]] = alloca i32, align 4
1397f90abac6SMike Rice // COMP-NEXT:    [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
1398f90abac6SMike Rice // COMP-NEXT:    [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
1399f90abac6SMike Rice // COMP-NEXT:    [[I:%.*]] = alloca i32, align 4
1400f90abac6SMike Rice // COMP-NEXT:    [[DOTOMP_LB:%.*]] = alloca i32, align 4
1401f90abac6SMike Rice // COMP-NEXT:    [[DOTOMP_UB:%.*]] = alloca i32, align 4
1402f90abac6SMike Rice // COMP-NEXT:    [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1403f90abac6SMike Rice // COMP-NEXT:    [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1404ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[RED3:%.*]] = alloca [[STRUCT_POINT:%.*]], align 4
1405ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[I4:%.*]] = alloca i32, align 4
1406f90abac6SMike Rice // COMP-NEXT:    [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [1 x i8*], align 8
1407f90abac6SMike Rice // COMP-NEXT:    store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
1408f90abac6SMike Rice // COMP-NEXT:    store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
1409ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store i32* [[N]], i32** [[N_ADDR]], align 8
1410ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store %struct.Point* [[RED]], %struct.Point** [[RED_ADDR]], align 8
1411ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store %struct.Point** [[POINTS]], %struct.Point*** [[POINTS_ADDR]], align 8
1412ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP0:%.*]] = load i32*, i32** [[N_ADDR]], align 8
1413ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP1:%.*]] = load %struct.Point*, %struct.Point** [[RED_ADDR]], align 8
1414ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP2:%.*]] = load %struct.Point**, %struct.Point*** [[POINTS_ADDR]], align 8
1415ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP3:%.*]] = load i32, i32* [[TMP0]], align 4
1416ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store i32 [[TMP3]], i32* [[DOTCAPTURE_EXPR_]], align 4
1417ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP4:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_]], align 4
1418ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[SUB:%.*]] = sub i32 [[TMP4]], 0
1419f90abac6SMike Rice // COMP-NEXT:    [[DIV:%.*]] = udiv i32 [[SUB]], 1
1420f90abac6SMike Rice // COMP-NEXT:    [[SUB2:%.*]] = sub i32 [[DIV]], 1
1421f90abac6SMike Rice // COMP-NEXT:    store i32 [[SUB2]], i32* [[DOTCAPTURE_EXPR_1]], align 4
1422f90abac6SMike Rice // COMP-NEXT:    store i32 0, i32* [[I]], align 4
1423ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP5:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_]], align 4
1424ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[CMP:%.*]] = icmp ult i32 0, [[TMP5]]
1425f90abac6SMike Rice // COMP-NEXT:    br i1 [[CMP]], label [[OMP_PRECOND_THEN:%.*]], label [[OMP_PRECOND_END:%.*]]
1426f90abac6SMike Rice // COMP:       omp.precond.then:
1427f90abac6SMike Rice // COMP-NEXT:    store i32 0, i32* [[DOTOMP_LB]], align 4
1428ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP6:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_1]], align 4
1429ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store i32 [[TMP6]], i32* [[DOTOMP_UB]], align 4
1430f90abac6SMike Rice // COMP-NEXT:    store i32 1, i32* [[DOTOMP_STRIDE]], align 4
1431f90abac6SMike Rice // COMP-NEXT:    store i32 0, i32* [[DOTOMP_IS_LAST]], align 4
1432ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    call void @_ZN5PointC1Ev(%struct.Point* nonnull align 4 dereferenceable(8) [[RED3]]) #[[ATTR4]]
1433ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP7:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
1434ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP8:%.*]] = load i32, i32* [[TMP7]], align 4
1435ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    call void @__kmpc_for_static_init_4u(%struct.ident_t* @[[GLOB1:[0-9]+]], i32 [[TMP8]], i32 34, i32* [[DOTOMP_IS_LAST]], i32* [[DOTOMP_LB]], i32* [[DOTOMP_UB]], i32* [[DOTOMP_STRIDE]], i32 1, i32 1)
1436ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP9:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
1437ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP10:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_1]], align 4
1438ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[CMP5:%.*]] = icmp ugt i32 [[TMP9]], [[TMP10]]
1439ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    br i1 [[CMP5]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1440f90abac6SMike Rice // COMP:       cond.true:
1441ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP11:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_1]], align 4
1442f90abac6SMike Rice // COMP-NEXT:    br label [[COND_END:%.*]]
1443f90abac6SMike Rice // COMP:       cond.false:
1444ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP12:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
1445f90abac6SMike Rice // COMP-NEXT:    br label [[COND_END]]
1446f90abac6SMike Rice // COMP:       cond.end:
1447ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[COND:%.*]] = phi i32 [ [[TMP11]], [[COND_TRUE]] ], [ [[TMP12]], [[COND_FALSE]] ]
1448f90abac6SMike Rice // COMP-NEXT:    store i32 [[COND]], i32* [[DOTOMP_UB]], align 4
1449ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP13:%.*]] = load i32, i32* [[DOTOMP_LB]], align 4
1450ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store i32 [[TMP13]], i32* [[DOTOMP_IV]], align 4
1451f90abac6SMike Rice // COMP-NEXT:    br label [[OMP_INNER_FOR_COND:%.*]]
1452f90abac6SMike Rice // COMP:       omp.inner.for.cond:
1453ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP14:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
1454ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP15:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
1455ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[ADD:%.*]] = add i32 [[TMP15]], 1
1456ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[CMP6:%.*]] = icmp ult i32 [[TMP14]], [[ADD]]
1457ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    br i1 [[CMP6]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1458f90abac6SMike Rice // COMP:       omp.inner.for.body:
1459ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP16:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
1460ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[MUL:%.*]] = mul i32 [[TMP16]], 1
1461ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[ADD7:%.*]] = add i32 0, [[MUL]]
1462ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store i32 [[ADD7]], i32* [[I4]], align 4
1463ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP17:%.*]] = load i32, i32* [[I4]], align 4
1464ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP18:%.*]] = load %struct.Point*, %struct.Point** [[TMP2]], align 8
1465ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    call void @_Z4workR5PointiPKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[RED3]], i32 [[TMP17]], %struct.Point* [[TMP18]])
1466f90abac6SMike Rice // COMP-NEXT:    br label [[OMP_BODY_CONTINUE:%.*]]
1467f90abac6SMike Rice // COMP:       omp.body.continue:
1468f90abac6SMike Rice // COMP-NEXT:    br label [[OMP_INNER_FOR_INC:%.*]]
1469f90abac6SMike Rice // COMP:       omp.inner.for.inc:
1470ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP19:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
1471ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[ADD8:%.*]] = add i32 [[TMP19]], 1
1472ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store i32 [[ADD8]], i32* [[DOTOMP_IV]], align 4
1473f90abac6SMike Rice // COMP-NEXT:    br label [[OMP_INNER_FOR_COND]]
1474f90abac6SMike Rice // COMP:       omp.inner.for.end:
1475f90abac6SMike Rice // COMP-NEXT:    br label [[OMP_LOOP_EXIT:%.*]]
1476f90abac6SMike Rice // COMP:       omp.loop.exit:
1477ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP20:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
1478ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP21:%.*]] = load i32, i32* [[TMP20]], align 4
1479ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    call void @__kmpc_for_static_fini(%struct.ident_t* @[[GLOB1]], i32 [[TMP21]])
1480ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP22:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 0
1481ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP23:%.*]] = bitcast %struct.Point* [[RED3]] to i8*
1482ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store i8* [[TMP23]], i8** [[TMP22]], align 8
1483f90abac6SMike Rice // COMP-NEXT:    [[TMP24:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
1484f90abac6SMike Rice // COMP-NEXT:    [[TMP25:%.*]] = load i32, i32* [[TMP24]], align 4
1485ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP26:%.*]] = bitcast [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8*
1486ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP27:%.*]] = call i32 @__kmpc_reduce_nowait(%struct.ident_t* @[[GLOB2:[0-9]+]], i32 [[TMP25]], i32 1, i64 8, i8* [[TMP26]], void (i8*, i8*)* @.omp.reduction.reduction_func, [8 x i32]* @.gomp_critical_user_.reduction.var)
1487ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    switch i32 [[TMP27]], label [[DOTOMP_REDUCTION_DEFAULT:%.*]] [
1488f90abac6SMike Rice // COMP-NEXT:    i32 1, label [[DOTOMP_REDUCTION_CASE1:%.*]]
1489f90abac6SMike Rice // COMP-NEXT:    i32 2, label [[DOTOMP_REDUCTION_CASE2:%.*]]
1490f90abac6SMike Rice // COMP-NEXT:    ]
1491f90abac6SMike Rice // COMP:       .omp.reduction.case1:
1492ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[CALL:%.*]] = call nonnull align 4 dereferenceable(8) %struct.Point* @_ZN5PointpLERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP1]], %struct.Point* nonnull align 4 dereferenceable(8) [[RED3]])
1493ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    call void @__kmpc_end_reduce_nowait(%struct.ident_t* @[[GLOB2]], i32 [[TMP25]], [8 x i32]* @.gomp_critical_user_.reduction.var)
1494f90abac6SMike Rice // COMP-NEXT:    br label [[DOTOMP_REDUCTION_DEFAULT]]
1495f90abac6SMike Rice // COMP:       .omp.reduction.case2:
1496ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP28:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
1497ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP29:%.*]] = load i32, i32* [[TMP28]], align 4
1498ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    call void @__kmpc_critical(%struct.ident_t* @[[GLOB3]], i32 [[TMP29]], [8 x i32]* @.gomp_critical_user_.atomic_reduction.var)
1499ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[CALL9:%.*]] = call nonnull align 4 dereferenceable(8) %struct.Point* @_ZN5PointpLERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP1]], %struct.Point* nonnull align 4 dereferenceable(8) [[RED3]])
1500ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    call void @__kmpc_end_critical(%struct.ident_t* @[[GLOB3]], i32 [[TMP29]], [8 x i32]* @.gomp_critical_user_.atomic_reduction.var)
1501f90abac6SMike Rice // COMP-NEXT:    br label [[DOTOMP_REDUCTION_DEFAULT]]
1502f90abac6SMike Rice // COMP:       .omp.reduction.default:
1503f90abac6SMike Rice // COMP-NEXT:    br label [[OMP_PRECOND_END]]
1504f90abac6SMike Rice // COMP:       omp.precond.end:
1505f90abac6SMike Rice // COMP-NEXT:    ret void
1506f90abac6SMike Rice //
1507f90abac6SMike Rice //
1508f90abac6SMike Rice // COMP-LABEL: define {{[^@]+}}@.omp.reduction.reduction_func
1509f90abac6SMike Rice // COMP-SAME: (i8* [[TMP0:%.*]], i8* [[TMP1:%.*]]) #[[ATTR5:[0-9]+]] {
1510f90abac6SMike Rice // COMP-NEXT:  entry:
1511f90abac6SMike Rice // COMP-NEXT:    [[DOTADDR:%.*]] = alloca i8*, align 8
1512f90abac6SMike Rice // COMP-NEXT:    [[DOTADDR1:%.*]] = alloca i8*, align 8
1513f90abac6SMike Rice // COMP-NEXT:    store i8* [[TMP0]], i8** [[DOTADDR]], align 8
1514f90abac6SMike Rice // COMP-NEXT:    store i8* [[TMP1]], i8** [[DOTADDR1]], align 8
1515f90abac6SMike Rice // COMP-NEXT:    [[TMP2:%.*]] = load i8*, i8** [[DOTADDR]], align 8
1516f90abac6SMike Rice // COMP-NEXT:    [[TMP3:%.*]] = bitcast i8* [[TMP2]] to [1 x i8*]*
1517f90abac6SMike Rice // COMP-NEXT:    [[TMP4:%.*]] = load i8*, i8** [[DOTADDR1]], align 8
1518f90abac6SMike Rice // COMP-NEXT:    [[TMP5:%.*]] = bitcast i8* [[TMP4]] to [1 x i8*]*
1519f90abac6SMike Rice // COMP-NEXT:    [[TMP6:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP5]], i64 0, i64 0
1520f90abac6SMike Rice // COMP-NEXT:    [[TMP7:%.*]] = load i8*, i8** [[TMP6]], align 8
1521f90abac6SMike Rice // COMP-NEXT:    [[TMP8:%.*]] = bitcast i8* [[TMP7]] to %struct.Point*
1522f90abac6SMike Rice // COMP-NEXT:    [[TMP9:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP3]], i64 0, i64 0
1523f90abac6SMike Rice // COMP-NEXT:    [[TMP10:%.*]] = load i8*, i8** [[TMP9]], align 8
1524f90abac6SMike Rice // COMP-NEXT:    [[TMP11:%.*]] = bitcast i8* [[TMP10]] to %struct.Point*
152516d03818SRoman Lebedev // COMP-NEXT:    [[CALL:%.*]] = call nonnull align 4 dereferenceable(8) %struct.Point* @_ZN5PointpLERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP11]], %struct.Point* nonnull align 4 dereferenceable(8) [[TMP8]])
1526f90abac6SMike Rice // COMP-NEXT:    ret void
1527f90abac6SMike Rice //
1528f90abac6SMike Rice //
1529f90abac6SMike Rice // COMP-LABEL: define {{[^@]+}}@.omp_outlined..1
1530ac90dfc4SGiorgis Georgakoudis // COMP-SAME: (i32* noalias [[DOTGLOBAL_TID_:%.*]], i32* noalias [[DOTBOUND_TID_:%.*]], i32* nonnull align 4 dereferenceable(4) [[N:%.*]], %struct.Point* nonnull align 4 dereferenceable(8) [[RED:%.*]], %struct.Point** nonnull align 8 dereferenceable(8) [[POINTS:%.*]]) #[[ATTR2]] {
1531f90abac6SMike Rice // COMP-NEXT:  entry:
1532f90abac6SMike Rice // COMP-NEXT:    [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
1533f90abac6SMike Rice // COMP-NEXT:    [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
1534ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[N_ADDR:%.*]] = alloca i32*, align 8
1535ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[RED_ADDR:%.*]] = alloca %struct.Point*, align 8
1536ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[POINTS_ADDR:%.*]] = alloca %struct.Point**, align 8
1537f90abac6SMike Rice // COMP-NEXT:    [[DOTOMP_IV:%.*]] = alloca i32, align 4
1538f90abac6SMike Rice // COMP-NEXT:    [[TMP:%.*]] = alloca i32, align 4
1539f90abac6SMike Rice // COMP-NEXT:    [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
1540f90abac6SMike Rice // COMP-NEXT:    [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
1541f90abac6SMike Rice // COMP-NEXT:    [[I:%.*]] = alloca i32, align 4
1542f90abac6SMike Rice // COMP-NEXT:    [[DOTOMP_LB:%.*]] = alloca i32, align 4
1543f90abac6SMike Rice // COMP-NEXT:    [[DOTOMP_UB:%.*]] = alloca i32, align 4
1544f90abac6SMike Rice // COMP-NEXT:    [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1545f90abac6SMike Rice // COMP-NEXT:    [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1546ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[RED3:%.*]] = alloca [[STRUCT_POINT:%.*]], align 4
1547ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[I4:%.*]] = alloca i32, align 4
1548f90abac6SMike Rice // COMP-NEXT:    [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [1 x i8*], align 8
1549f90abac6SMike Rice // COMP-NEXT:    store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
1550f90abac6SMike Rice // COMP-NEXT:    store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
1551ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store i32* [[N]], i32** [[N_ADDR]], align 8
1552ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store %struct.Point* [[RED]], %struct.Point** [[RED_ADDR]], align 8
1553ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store %struct.Point** [[POINTS]], %struct.Point*** [[POINTS_ADDR]], align 8
1554ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP0:%.*]] = load i32*, i32** [[N_ADDR]], align 8
1555ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP1:%.*]] = load %struct.Point*, %struct.Point** [[RED_ADDR]], align 8
1556ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP2:%.*]] = load %struct.Point**, %struct.Point*** [[POINTS_ADDR]], align 8
1557ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP3:%.*]] = load i32, i32* [[TMP0]], align 4
1558ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store i32 [[TMP3]], i32* [[DOTCAPTURE_EXPR_]], align 4
1559ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP4:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_]], align 4
1560ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[SUB:%.*]] = sub i32 [[TMP4]], 0
1561f90abac6SMike Rice // COMP-NEXT:    [[DIV:%.*]] = udiv i32 [[SUB]], 1
1562f90abac6SMike Rice // COMP-NEXT:    [[SUB2:%.*]] = sub i32 [[DIV]], 1
1563f90abac6SMike Rice // COMP-NEXT:    store i32 [[SUB2]], i32* [[DOTCAPTURE_EXPR_1]], align 4
1564f90abac6SMike Rice // COMP-NEXT:    store i32 0, i32* [[I]], align 4
1565ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP5:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_]], align 4
1566ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[CMP:%.*]] = icmp ult i32 0, [[TMP5]]
1567f90abac6SMike Rice // COMP-NEXT:    br i1 [[CMP]], label [[OMP_PRECOND_THEN:%.*]], label [[OMP_PRECOND_END:%.*]]
1568f90abac6SMike Rice // COMP:       omp.precond.then:
1569f90abac6SMike Rice // COMP-NEXT:    store i32 0, i32* [[DOTOMP_LB]], align 4
1570ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP6:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_1]], align 4
1571ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store i32 [[TMP6]], i32* [[DOTOMP_UB]], align 4
1572f90abac6SMike Rice // COMP-NEXT:    store i32 1, i32* [[DOTOMP_STRIDE]], align 4
1573f90abac6SMike Rice // COMP-NEXT:    store i32 0, i32* [[DOTOMP_IS_LAST]], align 4
1574ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    call void @_ZN5PointC1Ev(%struct.Point* nonnull align 4 dereferenceable(8) [[RED3]]) #[[ATTR4]]
1575ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP7:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
1576ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP8:%.*]] = load i32, i32* [[TMP7]], align 4
1577ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    call void @__kmpc_for_static_init_4u(%struct.ident_t* @[[GLOB1]], i32 [[TMP8]], i32 34, i32* [[DOTOMP_IS_LAST]], i32* [[DOTOMP_LB]], i32* [[DOTOMP_UB]], i32* [[DOTOMP_STRIDE]], i32 1, i32 1)
1578ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP9:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
1579ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP10:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_1]], align 4
1580ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[CMP5:%.*]] = icmp ugt i32 [[TMP9]], [[TMP10]]
1581ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    br i1 [[CMP5]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1582f90abac6SMike Rice // COMP:       cond.true:
1583ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP11:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_1]], align 4
1584f90abac6SMike Rice // COMP-NEXT:    br label [[COND_END:%.*]]
1585f90abac6SMike Rice // COMP:       cond.false:
1586ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP12:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
1587f90abac6SMike Rice // COMP-NEXT:    br label [[COND_END]]
1588f90abac6SMike Rice // COMP:       cond.end:
1589ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[COND:%.*]] = phi i32 [ [[TMP11]], [[COND_TRUE]] ], [ [[TMP12]], [[COND_FALSE]] ]
1590f90abac6SMike Rice // COMP-NEXT:    store i32 [[COND]], i32* [[DOTOMP_UB]], align 4
1591ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP13:%.*]] = load i32, i32* [[DOTOMP_LB]], align 4
1592ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store i32 [[TMP13]], i32* [[DOTOMP_IV]], align 4
1593f90abac6SMike Rice // COMP-NEXT:    br label [[OMP_INNER_FOR_COND:%.*]]
1594f90abac6SMike Rice // COMP:       omp.inner.for.cond:
1595ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP14:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
1596ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP15:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
1597ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[ADD:%.*]] = add i32 [[TMP15]], 1
1598ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[CMP6:%.*]] = icmp ult i32 [[TMP14]], [[ADD]]
1599ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    br i1 [[CMP6]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1600f90abac6SMike Rice // COMP:       omp.inner.for.body:
1601ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP16:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
1602ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[MUL:%.*]] = mul i32 [[TMP16]], 1
1603ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[ADD7:%.*]] = add i32 0, [[MUL]]
1604ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store i32 [[ADD7]], i32* [[I4]], align 4
1605ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP17:%.*]] = load i32, i32* [[I4]], align 4
1606ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP18:%.*]] = load %struct.Point*, %struct.Point** [[TMP2]], align 8
1607ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    call void @_Z4workR5PointiPKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[RED3]], i32 [[TMP17]], %struct.Point* [[TMP18]])
1608f90abac6SMike Rice // COMP-NEXT:    br label [[OMP_BODY_CONTINUE:%.*]]
1609f90abac6SMike Rice // COMP:       omp.body.continue:
1610f90abac6SMike Rice // COMP-NEXT:    br label [[OMP_INNER_FOR_INC:%.*]]
1611f90abac6SMike Rice // COMP:       omp.inner.for.inc:
1612ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP19:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
1613ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[ADD8:%.*]] = add i32 [[TMP19]], 1
1614ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store i32 [[ADD8]], i32* [[DOTOMP_IV]], align 4
1615f90abac6SMike Rice // COMP-NEXT:    br label [[OMP_INNER_FOR_COND]]
1616f90abac6SMike Rice // COMP:       omp.inner.for.end:
1617f90abac6SMike Rice // COMP-NEXT:    br label [[OMP_LOOP_EXIT:%.*]]
1618f90abac6SMike Rice // COMP:       omp.loop.exit:
1619ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP20:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
1620ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP21:%.*]] = load i32, i32* [[TMP20]], align 4
1621ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    call void @__kmpc_for_static_fini(%struct.ident_t* @[[GLOB1]], i32 [[TMP21]])
1622ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP22:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 0
1623ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP23:%.*]] = bitcast %struct.Point* [[RED3]] to i8*
1624ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store i8* [[TMP23]], i8** [[TMP22]], align 8
1625f90abac6SMike Rice // COMP-NEXT:    [[TMP24:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
1626f90abac6SMike Rice // COMP-NEXT:    [[TMP25:%.*]] = load i32, i32* [[TMP24]], align 4
1627ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP26:%.*]] = bitcast [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8*
1628ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP27:%.*]] = call i32 @__kmpc_reduce_nowait(%struct.ident_t* @[[GLOB2]], i32 [[TMP25]], i32 1, i64 8, i8* [[TMP26]], void (i8*, i8*)* @.omp.reduction.reduction_func.2, [8 x i32]* @.gomp_critical_user_.reduction.var)
1629ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    switch i32 [[TMP27]], label [[DOTOMP_REDUCTION_DEFAULT:%.*]] [
1630f90abac6SMike Rice // COMP-NEXT:    i32 1, label [[DOTOMP_REDUCTION_CASE1:%.*]]
1631f90abac6SMike Rice // COMP-NEXT:    i32 2, label [[DOTOMP_REDUCTION_CASE2:%.*]]
1632f90abac6SMike Rice // COMP-NEXT:    ]
1633f90abac6SMike Rice // COMP:       .omp.reduction.case1:
1634ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[CALL:%.*]] = call nonnull align 4 dereferenceable(8) %struct.Point* @_ZN5PointpLERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP1]], %struct.Point* nonnull align 4 dereferenceable(8) [[RED3]])
1635ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    call void @__kmpc_end_reduce_nowait(%struct.ident_t* @[[GLOB2]], i32 [[TMP25]], [8 x i32]* @.gomp_critical_user_.reduction.var)
1636f90abac6SMike Rice // COMP-NEXT:    br label [[DOTOMP_REDUCTION_DEFAULT]]
1637f90abac6SMike Rice // COMP:       .omp.reduction.case2:
1638ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP28:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
1639ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP29:%.*]] = load i32, i32* [[TMP28]], align 4
1640ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    call void @__kmpc_critical(%struct.ident_t* @[[GLOB3]], i32 [[TMP29]], [8 x i32]* @.gomp_critical_user_.atomic_reduction.var)
1641ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[CALL9:%.*]] = call nonnull align 4 dereferenceable(8) %struct.Point* @_ZN5PointpLERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP1]], %struct.Point* nonnull align 4 dereferenceable(8) [[RED3]])
1642ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    call void @__kmpc_end_critical(%struct.ident_t* @[[GLOB3]], i32 [[TMP29]], [8 x i32]* @.gomp_critical_user_.atomic_reduction.var)
1643f90abac6SMike Rice // COMP-NEXT:    br label [[DOTOMP_REDUCTION_DEFAULT]]
1644f90abac6SMike Rice // COMP:       .omp.reduction.default:
1645f90abac6SMike Rice // COMP-NEXT:    br label [[OMP_PRECOND_END]]
1646f90abac6SMike Rice // COMP:       omp.precond.end:
1647f90abac6SMike Rice // COMP-NEXT:    ret void
1648f90abac6SMike Rice //
1649f90abac6SMike Rice //
1650f90abac6SMike Rice // COMP-LABEL: define {{[^@]+}}@.omp.reduction.reduction_func.2
1651f90abac6SMike Rice // COMP-SAME: (i8* [[TMP0:%.*]], i8* [[TMP1:%.*]]) #[[ATTR5]] {
1652f90abac6SMike Rice // COMP-NEXT:  entry:
1653f90abac6SMike Rice // COMP-NEXT:    [[DOTADDR:%.*]] = alloca i8*, align 8
1654f90abac6SMike Rice // COMP-NEXT:    [[DOTADDR1:%.*]] = alloca i8*, align 8
1655f90abac6SMike Rice // COMP-NEXT:    store i8* [[TMP0]], i8** [[DOTADDR]], align 8
1656f90abac6SMike Rice // COMP-NEXT:    store i8* [[TMP1]], i8** [[DOTADDR1]], align 8
1657f90abac6SMike Rice // COMP-NEXT:    [[TMP2:%.*]] = load i8*, i8** [[DOTADDR]], align 8
1658f90abac6SMike Rice // COMP-NEXT:    [[TMP3:%.*]] = bitcast i8* [[TMP2]] to [1 x i8*]*
1659f90abac6SMike Rice // COMP-NEXT:    [[TMP4:%.*]] = load i8*, i8** [[DOTADDR1]], align 8
1660f90abac6SMike Rice // COMP-NEXT:    [[TMP5:%.*]] = bitcast i8* [[TMP4]] to [1 x i8*]*
1661f90abac6SMike Rice // COMP-NEXT:    [[TMP6:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP5]], i64 0, i64 0
1662f90abac6SMike Rice // COMP-NEXT:    [[TMP7:%.*]] = load i8*, i8** [[TMP6]], align 8
1663f90abac6SMike Rice // COMP-NEXT:    [[TMP8:%.*]] = bitcast i8* [[TMP7]] to %struct.Point*
1664f90abac6SMike Rice // COMP-NEXT:    [[TMP9:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP3]], i64 0, i64 0
1665f90abac6SMike Rice // COMP-NEXT:    [[TMP10:%.*]] = load i8*, i8** [[TMP9]], align 8
1666f90abac6SMike Rice // COMP-NEXT:    [[TMP11:%.*]] = bitcast i8* [[TMP10]] to %struct.Point*
166716d03818SRoman Lebedev // COMP-NEXT:    [[CALL:%.*]] = call nonnull align 4 dereferenceable(8) %struct.Point* @_ZN5PointpLERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP11]], %struct.Point* nonnull align 4 dereferenceable(8) [[TMP8]])
1668f90abac6SMike Rice // COMP-NEXT:    ret void
1669f90abac6SMike Rice //
1670f90abac6SMike Rice //
1671f90abac6SMike Rice // COMP-LABEL: define {{[^@]+}}@.omp_outlined..3
1672ac90dfc4SGiorgis Georgakoudis // COMP-SAME: (i32* noalias [[DOTGLOBAL_TID_:%.*]], i32* noalias [[DOTBOUND_TID_:%.*]], i32* nonnull align 4 dereferenceable(4) [[N:%.*]], %struct.Point* nonnull align 4 dereferenceable(8) [[RED:%.*]], %struct.Point** nonnull align 8 dereferenceable(8) [[POINTS:%.*]]) #[[ATTR2]] {
1673f90abac6SMike Rice // COMP-NEXT:  entry:
1674f90abac6SMike Rice // COMP-NEXT:    [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
1675f90abac6SMike Rice // COMP-NEXT:    [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
1676ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[N_ADDR:%.*]] = alloca i32*, align 8
1677ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[RED_ADDR:%.*]] = alloca %struct.Point*, align 8
1678ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[POINTS_ADDR:%.*]] = alloca %struct.Point**, align 8
1679f90abac6SMike Rice // COMP-NEXT:    [[DOTOMP_IV:%.*]] = alloca i32, align 4
1680f90abac6SMike Rice // COMP-NEXT:    [[TMP:%.*]] = alloca i32, align 4
1681f90abac6SMike Rice // COMP-NEXT:    [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
1682f90abac6SMike Rice // COMP-NEXT:    [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
1683f90abac6SMike Rice // COMP-NEXT:    [[I:%.*]] = alloca i32, align 4
1684f90abac6SMike Rice // COMP-NEXT:    [[DOTOMP_LB:%.*]] = alloca i32, align 4
1685f90abac6SMike Rice // COMP-NEXT:    [[DOTOMP_UB:%.*]] = alloca i32, align 4
1686f90abac6SMike Rice // COMP-NEXT:    [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1687f90abac6SMike Rice // COMP-NEXT:    [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1688ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[RED3:%.*]] = alloca [[STRUCT_POINT:%.*]], align 4
1689ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[I4:%.*]] = alloca i32, align 4
1690f90abac6SMike Rice // COMP-NEXT:    [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [1 x i8*], align 8
1691f90abac6SMike Rice // COMP-NEXT:    store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
1692f90abac6SMike Rice // COMP-NEXT:    store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
1693ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store i32* [[N]], i32** [[N_ADDR]], align 8
1694ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store %struct.Point* [[RED]], %struct.Point** [[RED_ADDR]], align 8
1695ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store %struct.Point** [[POINTS]], %struct.Point*** [[POINTS_ADDR]], align 8
1696ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP0:%.*]] = load i32*, i32** [[N_ADDR]], align 8
1697ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP1:%.*]] = load %struct.Point*, %struct.Point** [[RED_ADDR]], align 8
1698ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP2:%.*]] = load %struct.Point**, %struct.Point*** [[POINTS_ADDR]], align 8
1699ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP3:%.*]] = load i32, i32* [[TMP0]], align 4
1700ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store i32 [[TMP3]], i32* [[DOTCAPTURE_EXPR_]], align 4
1701ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP4:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_]], align 4
1702ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[SUB:%.*]] = sub i32 [[TMP4]], 0
1703f90abac6SMike Rice // COMP-NEXT:    [[DIV:%.*]] = udiv i32 [[SUB]], 1
1704f90abac6SMike Rice // COMP-NEXT:    [[SUB2:%.*]] = sub i32 [[DIV]], 1
1705f90abac6SMike Rice // COMP-NEXT:    store i32 [[SUB2]], i32* [[DOTCAPTURE_EXPR_1]], align 4
1706f90abac6SMike Rice // COMP-NEXT:    store i32 0, i32* [[I]], align 4
1707ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP5:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_]], align 4
1708ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[CMP:%.*]] = icmp ult i32 0, [[TMP5]]
1709f90abac6SMike Rice // COMP-NEXT:    br i1 [[CMP]], label [[OMP_PRECOND_THEN:%.*]], label [[OMP_PRECOND_END:%.*]]
1710f90abac6SMike Rice // COMP:       omp.precond.then:
1711f90abac6SMike Rice // COMP-NEXT:    store i32 0, i32* [[DOTOMP_LB]], align 4
1712ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP6:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_1]], align 4
1713ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store i32 [[TMP6]], i32* [[DOTOMP_UB]], align 4
1714f90abac6SMike Rice // COMP-NEXT:    store i32 1, i32* [[DOTOMP_STRIDE]], align 4
1715f90abac6SMike Rice // COMP-NEXT:    store i32 0, i32* [[DOTOMP_IS_LAST]], align 4
1716ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    call void @_ZN5PointC1Ev(%struct.Point* nonnull align 4 dereferenceable(8) [[RED3]]) #[[ATTR4]]
1717ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP7:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
1718ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP8:%.*]] = load i32, i32* [[TMP7]], align 4
1719ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    call void @__kmpc_for_static_init_4u(%struct.ident_t* @[[GLOB1]], i32 [[TMP8]], i32 34, i32* [[DOTOMP_IS_LAST]], i32* [[DOTOMP_LB]], i32* [[DOTOMP_UB]], i32* [[DOTOMP_STRIDE]], i32 1, i32 1)
1720ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP9:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
1721ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP10:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_1]], align 4
1722ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[CMP5:%.*]] = icmp ugt i32 [[TMP9]], [[TMP10]]
1723ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    br i1 [[CMP5]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1724f90abac6SMike Rice // COMP:       cond.true:
1725ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP11:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_1]], align 4
1726f90abac6SMike Rice // COMP-NEXT:    br label [[COND_END:%.*]]
1727f90abac6SMike Rice // COMP:       cond.false:
1728ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP12:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
1729f90abac6SMike Rice // COMP-NEXT:    br label [[COND_END]]
1730f90abac6SMike Rice // COMP:       cond.end:
1731ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[COND:%.*]] = phi i32 [ [[TMP11]], [[COND_TRUE]] ], [ [[TMP12]], [[COND_FALSE]] ]
1732f90abac6SMike Rice // COMP-NEXT:    store i32 [[COND]], i32* [[DOTOMP_UB]], align 4
1733ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP13:%.*]] = load i32, i32* [[DOTOMP_LB]], align 4
1734ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store i32 [[TMP13]], i32* [[DOTOMP_IV]], align 4
1735f90abac6SMike Rice // COMP-NEXT:    br label [[OMP_INNER_FOR_COND:%.*]]
1736f90abac6SMike Rice // COMP:       omp.inner.for.cond:
1737ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP14:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
1738ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP15:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
1739ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[ADD:%.*]] = add i32 [[TMP15]], 1
1740ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[CMP6:%.*]] = icmp ult i32 [[TMP14]], [[ADD]]
1741ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    br i1 [[CMP6]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1742f90abac6SMike Rice // COMP:       omp.inner.for.body:
1743ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP16:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
1744ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[MUL:%.*]] = mul i32 [[TMP16]], 1
1745ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[ADD7:%.*]] = add i32 0, [[MUL]]
1746ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store i32 [[ADD7]], i32* [[I4]], align 4
1747ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP17:%.*]] = load i32, i32* [[I4]], align 4
1748ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP18:%.*]] = load %struct.Point*, %struct.Point** [[TMP2]], align 8
1749ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    call void @_Z4workR5PointiPKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[RED3]], i32 [[TMP17]], %struct.Point* [[TMP18]])
1750f90abac6SMike Rice // COMP-NEXT:    br label [[OMP_BODY_CONTINUE:%.*]]
1751f90abac6SMike Rice // COMP:       omp.body.continue:
1752f90abac6SMike Rice // COMP-NEXT:    br label [[OMP_INNER_FOR_INC:%.*]]
1753f90abac6SMike Rice // COMP:       omp.inner.for.inc:
1754ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP19:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
1755ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[ADD8:%.*]] = add i32 [[TMP19]], 1
1756ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store i32 [[ADD8]], i32* [[DOTOMP_IV]], align 4
1757f90abac6SMike Rice // COMP-NEXT:    br label [[OMP_INNER_FOR_COND]]
1758f90abac6SMike Rice // COMP:       omp.inner.for.end:
1759f90abac6SMike Rice // COMP-NEXT:    br label [[OMP_LOOP_EXIT:%.*]]
1760f90abac6SMike Rice // COMP:       omp.loop.exit:
1761ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP20:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
1762ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP21:%.*]] = load i32, i32* [[TMP20]], align 4
1763ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    call void @__kmpc_for_static_fini(%struct.ident_t* @[[GLOB1]], i32 [[TMP21]])
1764ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP22:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 0
1765ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP23:%.*]] = bitcast %struct.Point* [[RED3]] to i8*
1766ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store i8* [[TMP23]], i8** [[TMP22]], align 8
1767f90abac6SMike Rice // COMP-NEXT:    [[TMP24:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
1768f90abac6SMike Rice // COMP-NEXT:    [[TMP25:%.*]] = load i32, i32* [[TMP24]], align 4
1769ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP26:%.*]] = bitcast [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8*
1770ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP27:%.*]] = call i32 @__kmpc_reduce_nowait(%struct.ident_t* @[[GLOB2]], i32 [[TMP25]], i32 1, i64 8, i8* [[TMP26]], void (i8*, i8*)* @.omp.reduction.reduction_func.4, [8 x i32]* @.gomp_critical_user_.reduction.var)
1771ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    switch i32 [[TMP27]], label [[DOTOMP_REDUCTION_DEFAULT:%.*]] [
1772f90abac6SMike Rice // COMP-NEXT:    i32 1, label [[DOTOMP_REDUCTION_CASE1:%.*]]
1773f90abac6SMike Rice // COMP-NEXT:    i32 2, label [[DOTOMP_REDUCTION_CASE2:%.*]]
1774f90abac6SMike Rice // COMP-NEXT:    ]
1775f90abac6SMike Rice // COMP:       .omp.reduction.case1:
1776ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[CALL:%.*]] = call nonnull align 4 dereferenceable(8) %struct.Point* @_ZN5PointmLERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP1]], %struct.Point* nonnull align 4 dereferenceable(8) [[RED3]])
1777ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    call void @__kmpc_end_reduce_nowait(%struct.ident_t* @[[GLOB2]], i32 [[TMP25]], [8 x i32]* @.gomp_critical_user_.reduction.var)
1778f90abac6SMike Rice // COMP-NEXT:    br label [[DOTOMP_REDUCTION_DEFAULT]]
1779f90abac6SMike Rice // COMP:       .omp.reduction.case2:
1780ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP28:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
1781ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP29:%.*]] = load i32, i32* [[TMP28]], align 4
1782ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    call void @__kmpc_critical(%struct.ident_t* @[[GLOB3]], i32 [[TMP29]], [8 x i32]* @.gomp_critical_user_.atomic_reduction.var)
1783ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[CALL9:%.*]] = call nonnull align 4 dereferenceable(8) %struct.Point* @_ZN5PointmLERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP1]], %struct.Point* nonnull align 4 dereferenceable(8) [[RED3]])
1784ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    call void @__kmpc_end_critical(%struct.ident_t* @[[GLOB3]], i32 [[TMP29]], [8 x i32]* @.gomp_critical_user_.atomic_reduction.var)
1785f90abac6SMike Rice // COMP-NEXT:    br label [[DOTOMP_REDUCTION_DEFAULT]]
1786f90abac6SMike Rice // COMP:       .omp.reduction.default:
1787f90abac6SMike Rice // COMP-NEXT:    br label [[OMP_PRECOND_END]]
1788f90abac6SMike Rice // COMP:       omp.precond.end:
1789f90abac6SMike Rice // COMP-NEXT:    ret void
1790f90abac6SMike Rice //
1791f90abac6SMike Rice //
1792f90abac6SMike Rice // COMP-LABEL: define {{[^@]+}}@.omp.reduction.reduction_func.4
1793f90abac6SMike Rice // COMP-SAME: (i8* [[TMP0:%.*]], i8* [[TMP1:%.*]]) #[[ATTR5]] {
1794f90abac6SMike Rice // COMP-NEXT:  entry:
1795f90abac6SMike Rice // COMP-NEXT:    [[DOTADDR:%.*]] = alloca i8*, align 8
1796f90abac6SMike Rice // COMP-NEXT:    [[DOTADDR1:%.*]] = alloca i8*, align 8
1797f90abac6SMike Rice // COMP-NEXT:    store i8* [[TMP0]], i8** [[DOTADDR]], align 8
1798f90abac6SMike Rice // COMP-NEXT:    store i8* [[TMP1]], i8** [[DOTADDR1]], align 8
1799f90abac6SMike Rice // COMP-NEXT:    [[TMP2:%.*]] = load i8*, i8** [[DOTADDR]], align 8
1800f90abac6SMike Rice // COMP-NEXT:    [[TMP3:%.*]] = bitcast i8* [[TMP2]] to [1 x i8*]*
1801f90abac6SMike Rice // COMP-NEXT:    [[TMP4:%.*]] = load i8*, i8** [[DOTADDR1]], align 8
1802f90abac6SMike Rice // COMP-NEXT:    [[TMP5:%.*]] = bitcast i8* [[TMP4]] to [1 x i8*]*
1803f90abac6SMike Rice // COMP-NEXT:    [[TMP6:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP5]], i64 0, i64 0
1804f90abac6SMike Rice // COMP-NEXT:    [[TMP7:%.*]] = load i8*, i8** [[TMP6]], align 8
1805f90abac6SMike Rice // COMP-NEXT:    [[TMP8:%.*]] = bitcast i8* [[TMP7]] to %struct.Point*
1806f90abac6SMike Rice // COMP-NEXT:    [[TMP9:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP3]], i64 0, i64 0
1807f90abac6SMike Rice // COMP-NEXT:    [[TMP10:%.*]] = load i8*, i8** [[TMP9]], align 8
1808f90abac6SMike Rice // COMP-NEXT:    [[TMP11:%.*]] = bitcast i8* [[TMP10]] to %struct.Point*
180916d03818SRoman Lebedev // COMP-NEXT:    [[CALL:%.*]] = call nonnull align 4 dereferenceable(8) %struct.Point* @_ZN5PointmLERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP11]], %struct.Point* nonnull align 4 dereferenceable(8) [[TMP8]])
1810f90abac6SMike Rice // COMP-NEXT:    ret void
1811f90abac6SMike Rice //
1812f90abac6SMike Rice //
1813f90abac6SMike Rice // COMP-LABEL: define {{[^@]+}}@.omp_outlined..5
1814ac90dfc4SGiorgis Georgakoudis // COMP-SAME: (i32* noalias [[DOTGLOBAL_TID_:%.*]], i32* noalias [[DOTBOUND_TID_:%.*]], i32* nonnull align 4 dereferenceable(4) [[N:%.*]], %struct.Point* nonnull align 4 dereferenceable(8) [[RED:%.*]], %struct.Point** nonnull align 8 dereferenceable(8) [[POINTS:%.*]]) #[[ATTR2]] {
1815f90abac6SMike Rice // COMP-NEXT:  entry:
1816f90abac6SMike Rice // COMP-NEXT:    [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
1817f90abac6SMike Rice // COMP-NEXT:    [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
1818ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[N_ADDR:%.*]] = alloca i32*, align 8
1819ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[RED_ADDR:%.*]] = alloca %struct.Point*, align 8
1820ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[POINTS_ADDR:%.*]] = alloca %struct.Point**, align 8
1821f90abac6SMike Rice // COMP-NEXT:    [[DOTOMP_IV:%.*]] = alloca i32, align 4
1822f90abac6SMike Rice // COMP-NEXT:    [[TMP:%.*]] = alloca i32, align 4
1823f90abac6SMike Rice // COMP-NEXT:    [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
1824f90abac6SMike Rice // COMP-NEXT:    [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
1825f90abac6SMike Rice // COMP-NEXT:    [[I:%.*]] = alloca i32, align 4
1826f90abac6SMike Rice // COMP-NEXT:    [[DOTOMP_LB:%.*]] = alloca i32, align 4
1827f90abac6SMike Rice // COMP-NEXT:    [[DOTOMP_UB:%.*]] = alloca i32, align 4
1828f90abac6SMike Rice // COMP-NEXT:    [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1829f90abac6SMike Rice // COMP-NEXT:    [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1830ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[RED3:%.*]] = alloca [[STRUCT_POINT:%.*]], align 4
1831ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[I4:%.*]] = alloca i32, align 4
1832f90abac6SMike Rice // COMP-NEXT:    [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [1 x i8*], align 8
1833f90abac6SMike Rice // COMP-NEXT:    store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
1834f90abac6SMike Rice // COMP-NEXT:    store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
1835ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store i32* [[N]], i32** [[N_ADDR]], align 8
1836ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store %struct.Point* [[RED]], %struct.Point** [[RED_ADDR]], align 8
1837ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store %struct.Point** [[POINTS]], %struct.Point*** [[POINTS_ADDR]], align 8
1838ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP0:%.*]] = load i32*, i32** [[N_ADDR]], align 8
1839ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP1:%.*]] = load %struct.Point*, %struct.Point** [[RED_ADDR]], align 8
1840ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP2:%.*]] = load %struct.Point**, %struct.Point*** [[POINTS_ADDR]], align 8
1841ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP3:%.*]] = load i32, i32* [[TMP0]], align 4
1842ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store i32 [[TMP3]], i32* [[DOTCAPTURE_EXPR_]], align 4
1843ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP4:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_]], align 4
1844ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[SUB:%.*]] = sub i32 [[TMP4]], 0
1845f90abac6SMike Rice // COMP-NEXT:    [[DIV:%.*]] = udiv i32 [[SUB]], 1
1846f90abac6SMike Rice // COMP-NEXT:    [[SUB2:%.*]] = sub i32 [[DIV]], 1
1847f90abac6SMike Rice // COMP-NEXT:    store i32 [[SUB2]], i32* [[DOTCAPTURE_EXPR_1]], align 4
1848f90abac6SMike Rice // COMP-NEXT:    store i32 0, i32* [[I]], align 4
1849ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP5:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_]], align 4
1850ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[CMP:%.*]] = icmp ult i32 0, [[TMP5]]
1851f90abac6SMike Rice // COMP-NEXT:    br i1 [[CMP]], label [[OMP_PRECOND_THEN:%.*]], label [[OMP_PRECOND_END:%.*]]
1852f90abac6SMike Rice // COMP:       omp.precond.then:
1853f90abac6SMike Rice // COMP-NEXT:    store i32 0, i32* [[DOTOMP_LB]], align 4
1854ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP6:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_1]], align 4
1855ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store i32 [[TMP6]], i32* [[DOTOMP_UB]], align 4
1856f90abac6SMike Rice // COMP-NEXT:    store i32 1, i32* [[DOTOMP_STRIDE]], align 4
1857f90abac6SMike Rice // COMP-NEXT:    store i32 0, i32* [[DOTOMP_IS_LAST]], align 4
1858ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    call void @_ZN5PointC1Ev(%struct.Point* nonnull align 4 dereferenceable(8) [[RED3]]) #[[ATTR4]]
1859ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP7:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
1860ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP8:%.*]] = load i32, i32* [[TMP7]], align 4
1861ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    call void @__kmpc_for_static_init_4u(%struct.ident_t* @[[GLOB1]], i32 [[TMP8]], i32 34, i32* [[DOTOMP_IS_LAST]], i32* [[DOTOMP_LB]], i32* [[DOTOMP_UB]], i32* [[DOTOMP_STRIDE]], i32 1, i32 1)
1862ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP9:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
1863ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP10:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_1]], align 4
1864ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[CMP5:%.*]] = icmp ugt i32 [[TMP9]], [[TMP10]]
1865ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    br i1 [[CMP5]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1866f90abac6SMike Rice // COMP:       cond.true:
1867ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP11:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_1]], align 4
1868f90abac6SMike Rice // COMP-NEXT:    br label [[COND_END:%.*]]
1869f90abac6SMike Rice // COMP:       cond.false:
1870ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP12:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
1871f90abac6SMike Rice // COMP-NEXT:    br label [[COND_END]]
1872f90abac6SMike Rice // COMP:       cond.end:
1873ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[COND:%.*]] = phi i32 [ [[TMP11]], [[COND_TRUE]] ], [ [[TMP12]], [[COND_FALSE]] ]
1874f90abac6SMike Rice // COMP-NEXT:    store i32 [[COND]], i32* [[DOTOMP_UB]], align 4
1875ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP13:%.*]] = load i32, i32* [[DOTOMP_LB]], align 4
1876ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store i32 [[TMP13]], i32* [[DOTOMP_IV]], align 4
1877f90abac6SMike Rice // COMP-NEXT:    br label [[OMP_INNER_FOR_COND:%.*]]
1878f90abac6SMike Rice // COMP:       omp.inner.for.cond:
1879ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP14:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
1880ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP15:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
1881ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[ADD:%.*]] = add i32 [[TMP15]], 1
1882ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[CMP6:%.*]] = icmp ult i32 [[TMP14]], [[ADD]]
1883ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    br i1 [[CMP6]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1884f90abac6SMike Rice // COMP:       omp.inner.for.body:
1885ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP16:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
1886ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[MUL:%.*]] = mul i32 [[TMP16]], 1
1887ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[ADD7:%.*]] = add i32 0, [[MUL]]
1888ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store i32 [[ADD7]], i32* [[I4]], align 4
1889ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP17:%.*]] = load i32, i32* [[I4]], align 4
1890ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP18:%.*]] = load %struct.Point*, %struct.Point** [[TMP2]], align 8
1891ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    call void @_Z4workR5PointiPKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[RED3]], i32 [[TMP17]], %struct.Point* [[TMP18]])
1892f90abac6SMike Rice // COMP-NEXT:    br label [[OMP_BODY_CONTINUE:%.*]]
1893f90abac6SMike Rice // COMP:       omp.body.continue:
1894f90abac6SMike Rice // COMP-NEXT:    br label [[OMP_INNER_FOR_INC:%.*]]
1895f90abac6SMike Rice // COMP:       omp.inner.for.inc:
1896ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP19:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
1897ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[ADD8:%.*]] = add i32 [[TMP19]], 1
1898ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store i32 [[ADD8]], i32* [[DOTOMP_IV]], align 4
1899f90abac6SMike Rice // COMP-NEXT:    br label [[OMP_INNER_FOR_COND]]
1900f90abac6SMike Rice // COMP:       omp.inner.for.end:
1901f90abac6SMike Rice // COMP-NEXT:    br label [[OMP_LOOP_EXIT:%.*]]
1902f90abac6SMike Rice // COMP:       omp.loop.exit:
1903ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP20:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
1904ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP21:%.*]] = load i32, i32* [[TMP20]], align 4
1905ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    call void @__kmpc_for_static_fini(%struct.ident_t* @[[GLOB1]], i32 [[TMP21]])
1906ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP22:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 0
1907ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP23:%.*]] = bitcast %struct.Point* [[RED3]] to i8*
1908ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store i8* [[TMP23]], i8** [[TMP22]], align 8
1909f90abac6SMike Rice // COMP-NEXT:    [[TMP24:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
1910f90abac6SMike Rice // COMP-NEXT:    [[TMP25:%.*]] = load i32, i32* [[TMP24]], align 4
1911ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP26:%.*]] = bitcast [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8*
1912ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP27:%.*]] = call i32 @__kmpc_reduce_nowait(%struct.ident_t* @[[GLOB2]], i32 [[TMP25]], i32 1, i64 8, i8* [[TMP26]], void (i8*, i8*)* @.omp.reduction.reduction_func.6, [8 x i32]* @.gomp_critical_user_.reduction.var)
1913ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    switch i32 [[TMP27]], label [[DOTOMP_REDUCTION_DEFAULT:%.*]] [
1914f90abac6SMike Rice // COMP-NEXT:    i32 1, label [[DOTOMP_REDUCTION_CASE1:%.*]]
1915f90abac6SMike Rice // COMP-NEXT:    i32 2, label [[DOTOMP_REDUCTION_CASE2:%.*]]
1916f90abac6SMike Rice // COMP-NEXT:    ]
1917f90abac6SMike Rice // COMP:       .omp.reduction.case1:
1918ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[CALL:%.*]] = call nonnull align 4 dereferenceable(8) %struct.Point* @_ZN5PointaNERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP1]], %struct.Point* nonnull align 4 dereferenceable(8) [[RED3]])
1919ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    call void @__kmpc_end_reduce_nowait(%struct.ident_t* @[[GLOB2]], i32 [[TMP25]], [8 x i32]* @.gomp_critical_user_.reduction.var)
1920f90abac6SMike Rice // COMP-NEXT:    br label [[DOTOMP_REDUCTION_DEFAULT]]
1921f90abac6SMike Rice // COMP:       .omp.reduction.case2:
1922ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP28:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
1923ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP29:%.*]] = load i32, i32* [[TMP28]], align 4
1924ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    call void @__kmpc_critical(%struct.ident_t* @[[GLOB3]], i32 [[TMP29]], [8 x i32]* @.gomp_critical_user_.atomic_reduction.var)
1925ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[CALL9:%.*]] = call nonnull align 4 dereferenceable(8) %struct.Point* @_ZN5PointaNERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP1]], %struct.Point* nonnull align 4 dereferenceable(8) [[RED3]])
1926ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    call void @__kmpc_end_critical(%struct.ident_t* @[[GLOB3]], i32 [[TMP29]], [8 x i32]* @.gomp_critical_user_.atomic_reduction.var)
1927f90abac6SMike Rice // COMP-NEXT:    br label [[DOTOMP_REDUCTION_DEFAULT]]
1928f90abac6SMike Rice // COMP:       .omp.reduction.default:
1929f90abac6SMike Rice // COMP-NEXT:    br label [[OMP_PRECOND_END]]
1930f90abac6SMike Rice // COMP:       omp.precond.end:
1931f90abac6SMike Rice // COMP-NEXT:    ret void
1932f90abac6SMike Rice //
1933f90abac6SMike Rice //
1934f90abac6SMike Rice // COMP-LABEL: define {{[^@]+}}@.omp.reduction.reduction_func.6
1935f90abac6SMike Rice // COMP-SAME: (i8* [[TMP0:%.*]], i8* [[TMP1:%.*]]) #[[ATTR5]] {
1936f90abac6SMike Rice // COMP-NEXT:  entry:
1937f90abac6SMike Rice // COMP-NEXT:    [[DOTADDR:%.*]] = alloca i8*, align 8
1938f90abac6SMike Rice // COMP-NEXT:    [[DOTADDR1:%.*]] = alloca i8*, align 8
1939f90abac6SMike Rice // COMP-NEXT:    store i8* [[TMP0]], i8** [[DOTADDR]], align 8
1940f90abac6SMike Rice // COMP-NEXT:    store i8* [[TMP1]], i8** [[DOTADDR1]], align 8
1941f90abac6SMike Rice // COMP-NEXT:    [[TMP2:%.*]] = load i8*, i8** [[DOTADDR]], align 8
1942f90abac6SMike Rice // COMP-NEXT:    [[TMP3:%.*]] = bitcast i8* [[TMP2]] to [1 x i8*]*
1943f90abac6SMike Rice // COMP-NEXT:    [[TMP4:%.*]] = load i8*, i8** [[DOTADDR1]], align 8
1944f90abac6SMike Rice // COMP-NEXT:    [[TMP5:%.*]] = bitcast i8* [[TMP4]] to [1 x i8*]*
1945f90abac6SMike Rice // COMP-NEXT:    [[TMP6:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP5]], i64 0, i64 0
1946f90abac6SMike Rice // COMP-NEXT:    [[TMP7:%.*]] = load i8*, i8** [[TMP6]], align 8
1947f90abac6SMike Rice // COMP-NEXT:    [[TMP8:%.*]] = bitcast i8* [[TMP7]] to %struct.Point*
1948f90abac6SMike Rice // COMP-NEXT:    [[TMP9:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP3]], i64 0, i64 0
1949f90abac6SMike Rice // COMP-NEXT:    [[TMP10:%.*]] = load i8*, i8** [[TMP9]], align 8
1950f90abac6SMike Rice // COMP-NEXT:    [[TMP11:%.*]] = bitcast i8* [[TMP10]] to %struct.Point*
195116d03818SRoman Lebedev // COMP-NEXT:    [[CALL:%.*]] = call nonnull align 4 dereferenceable(8) %struct.Point* @_ZN5PointaNERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP11]], %struct.Point* nonnull align 4 dereferenceable(8) [[TMP8]])
1952f90abac6SMike Rice // COMP-NEXT:    ret void
1953f90abac6SMike Rice //
1954f90abac6SMike Rice //
1955f90abac6SMike Rice // COMP-LABEL: define {{[^@]+}}@.omp_outlined..7
1956ac90dfc4SGiorgis Georgakoudis // COMP-SAME: (i32* noalias [[DOTGLOBAL_TID_:%.*]], i32* noalias [[DOTBOUND_TID_:%.*]], i32* nonnull align 4 dereferenceable(4) [[N:%.*]], %struct.Point* nonnull align 4 dereferenceable(8) [[RED:%.*]], %struct.Point** nonnull align 8 dereferenceable(8) [[POINTS:%.*]]) #[[ATTR2]] {
1957f90abac6SMike Rice // COMP-NEXT:  entry:
1958f90abac6SMike Rice // COMP-NEXT:    [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
1959f90abac6SMike Rice // COMP-NEXT:    [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
1960ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[N_ADDR:%.*]] = alloca i32*, align 8
1961ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[RED_ADDR:%.*]] = alloca %struct.Point*, align 8
1962ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[POINTS_ADDR:%.*]] = alloca %struct.Point**, align 8
1963f90abac6SMike Rice // COMP-NEXT:    [[DOTOMP_IV:%.*]] = alloca i32, align 4
1964f90abac6SMike Rice // COMP-NEXT:    [[TMP:%.*]] = alloca i32, align 4
1965f90abac6SMike Rice // COMP-NEXT:    [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
1966f90abac6SMike Rice // COMP-NEXT:    [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
1967f90abac6SMike Rice // COMP-NEXT:    [[I:%.*]] = alloca i32, align 4
1968f90abac6SMike Rice // COMP-NEXT:    [[DOTOMP_LB:%.*]] = alloca i32, align 4
1969f90abac6SMike Rice // COMP-NEXT:    [[DOTOMP_UB:%.*]] = alloca i32, align 4
1970f90abac6SMike Rice // COMP-NEXT:    [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1971f90abac6SMike Rice // COMP-NEXT:    [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1972ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[RED3:%.*]] = alloca [[STRUCT_POINT:%.*]], align 4
1973ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[I4:%.*]] = alloca i32, align 4
1974f90abac6SMike Rice // COMP-NEXT:    [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [1 x i8*], align 8
1975f90abac6SMike Rice // COMP-NEXT:    store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
1976f90abac6SMike Rice // COMP-NEXT:    store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
1977ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store i32* [[N]], i32** [[N_ADDR]], align 8
1978ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store %struct.Point* [[RED]], %struct.Point** [[RED_ADDR]], align 8
1979ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store %struct.Point** [[POINTS]], %struct.Point*** [[POINTS_ADDR]], align 8
1980ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP0:%.*]] = load i32*, i32** [[N_ADDR]], align 8
1981ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP1:%.*]] = load %struct.Point*, %struct.Point** [[RED_ADDR]], align 8
1982ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP2:%.*]] = load %struct.Point**, %struct.Point*** [[POINTS_ADDR]], align 8
1983ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP3:%.*]] = load i32, i32* [[TMP0]], align 4
1984ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store i32 [[TMP3]], i32* [[DOTCAPTURE_EXPR_]], align 4
1985ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP4:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_]], align 4
1986ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[SUB:%.*]] = sub i32 [[TMP4]], 0
1987f90abac6SMike Rice // COMP-NEXT:    [[DIV:%.*]] = udiv i32 [[SUB]], 1
1988f90abac6SMike Rice // COMP-NEXT:    [[SUB2:%.*]] = sub i32 [[DIV]], 1
1989f90abac6SMike Rice // COMP-NEXT:    store i32 [[SUB2]], i32* [[DOTCAPTURE_EXPR_1]], align 4
1990f90abac6SMike Rice // COMP-NEXT:    store i32 0, i32* [[I]], align 4
1991ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP5:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_]], align 4
1992ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[CMP:%.*]] = icmp ult i32 0, [[TMP5]]
1993f90abac6SMike Rice // COMP-NEXT:    br i1 [[CMP]], label [[OMP_PRECOND_THEN:%.*]], label [[OMP_PRECOND_END:%.*]]
1994f90abac6SMike Rice // COMP:       omp.precond.then:
1995f90abac6SMike Rice // COMP-NEXT:    store i32 0, i32* [[DOTOMP_LB]], align 4
1996ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP6:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_1]], align 4
1997ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store i32 [[TMP6]], i32* [[DOTOMP_UB]], align 4
1998f90abac6SMike Rice // COMP-NEXT:    store i32 1, i32* [[DOTOMP_STRIDE]], align 4
1999f90abac6SMike Rice // COMP-NEXT:    store i32 0, i32* [[DOTOMP_IS_LAST]], align 4
2000ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    call void @_ZN5PointC1Ev(%struct.Point* nonnull align 4 dereferenceable(8) [[RED3]]) #[[ATTR4]]
2001ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP7:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
2002ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP8:%.*]] = load i32, i32* [[TMP7]], align 4
2003ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    call void @__kmpc_for_static_init_4u(%struct.ident_t* @[[GLOB1]], i32 [[TMP8]], i32 34, i32* [[DOTOMP_IS_LAST]], i32* [[DOTOMP_LB]], i32* [[DOTOMP_UB]], i32* [[DOTOMP_STRIDE]], i32 1, i32 1)
2004ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP9:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
2005ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP10:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_1]], align 4
2006ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[CMP5:%.*]] = icmp ugt i32 [[TMP9]], [[TMP10]]
2007ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    br i1 [[CMP5]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
2008f90abac6SMike Rice // COMP:       cond.true:
2009ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP11:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_1]], align 4
2010f90abac6SMike Rice // COMP-NEXT:    br label [[COND_END:%.*]]
2011f90abac6SMike Rice // COMP:       cond.false:
2012ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP12:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
2013f90abac6SMike Rice // COMP-NEXT:    br label [[COND_END]]
2014f90abac6SMike Rice // COMP:       cond.end:
2015ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[COND:%.*]] = phi i32 [ [[TMP11]], [[COND_TRUE]] ], [ [[TMP12]], [[COND_FALSE]] ]
2016f90abac6SMike Rice // COMP-NEXT:    store i32 [[COND]], i32* [[DOTOMP_UB]], align 4
2017ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP13:%.*]] = load i32, i32* [[DOTOMP_LB]], align 4
2018ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store i32 [[TMP13]], i32* [[DOTOMP_IV]], align 4
2019f90abac6SMike Rice // COMP-NEXT:    br label [[OMP_INNER_FOR_COND:%.*]]
2020f90abac6SMike Rice // COMP:       omp.inner.for.cond:
2021ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP14:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
2022ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP15:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
2023ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[ADD:%.*]] = add i32 [[TMP15]], 1
2024ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[CMP6:%.*]] = icmp ult i32 [[TMP14]], [[ADD]]
2025ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    br i1 [[CMP6]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
2026f90abac6SMike Rice // COMP:       omp.inner.for.body:
2027ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP16:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
2028ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[MUL:%.*]] = mul i32 [[TMP16]], 1
2029ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[ADD7:%.*]] = add i32 0, [[MUL]]
2030ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store i32 [[ADD7]], i32* [[I4]], align 4
2031ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP17:%.*]] = load i32, i32* [[I4]], align 4
2032ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP18:%.*]] = load %struct.Point*, %struct.Point** [[TMP2]], align 8
2033ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    call void @_Z4workR5PointiPKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[RED3]], i32 [[TMP17]], %struct.Point* [[TMP18]])
2034f90abac6SMike Rice // COMP-NEXT:    br label [[OMP_BODY_CONTINUE:%.*]]
2035f90abac6SMike Rice // COMP:       omp.body.continue:
2036f90abac6SMike Rice // COMP-NEXT:    br label [[OMP_INNER_FOR_INC:%.*]]
2037f90abac6SMike Rice // COMP:       omp.inner.for.inc:
2038ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP19:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
2039ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[ADD8:%.*]] = add i32 [[TMP19]], 1
2040ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store i32 [[ADD8]], i32* [[DOTOMP_IV]], align 4
2041f90abac6SMike Rice // COMP-NEXT:    br label [[OMP_INNER_FOR_COND]]
2042f90abac6SMike Rice // COMP:       omp.inner.for.end:
2043f90abac6SMike Rice // COMP-NEXT:    br label [[OMP_LOOP_EXIT:%.*]]
2044f90abac6SMike Rice // COMP:       omp.loop.exit:
2045ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP20:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
2046ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP21:%.*]] = load i32, i32* [[TMP20]], align 4
2047ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    call void @__kmpc_for_static_fini(%struct.ident_t* @[[GLOB1]], i32 [[TMP21]])
2048ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP22:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 0
2049ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP23:%.*]] = bitcast %struct.Point* [[RED3]] to i8*
2050ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store i8* [[TMP23]], i8** [[TMP22]], align 8
2051f90abac6SMike Rice // COMP-NEXT:    [[TMP24:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
2052f90abac6SMike Rice // COMP-NEXT:    [[TMP25:%.*]] = load i32, i32* [[TMP24]], align 4
2053ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP26:%.*]] = bitcast [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8*
2054ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP27:%.*]] = call i32 @__kmpc_reduce_nowait(%struct.ident_t* @[[GLOB2]], i32 [[TMP25]], i32 1, i64 8, i8* [[TMP26]], void (i8*, i8*)* @.omp.reduction.reduction_func.8, [8 x i32]* @.gomp_critical_user_.reduction.var)
2055ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    switch i32 [[TMP27]], label [[DOTOMP_REDUCTION_DEFAULT:%.*]] [
2056f90abac6SMike Rice // COMP-NEXT:    i32 1, label [[DOTOMP_REDUCTION_CASE1:%.*]]
2057f90abac6SMike Rice // COMP-NEXT:    i32 2, label [[DOTOMP_REDUCTION_CASE2:%.*]]
2058f90abac6SMike Rice // COMP-NEXT:    ]
2059f90abac6SMike Rice // COMP:       .omp.reduction.case1:
2060ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[CALL:%.*]] = call nonnull align 4 dereferenceable(8) %struct.Point* @_ZN5PointoRERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP1]], %struct.Point* nonnull align 4 dereferenceable(8) [[RED3]])
2061ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    call void @__kmpc_end_reduce_nowait(%struct.ident_t* @[[GLOB2]], i32 [[TMP25]], [8 x i32]* @.gomp_critical_user_.reduction.var)
2062f90abac6SMike Rice // COMP-NEXT:    br label [[DOTOMP_REDUCTION_DEFAULT]]
2063f90abac6SMike Rice // COMP:       .omp.reduction.case2:
2064ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP28:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
2065ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP29:%.*]] = load i32, i32* [[TMP28]], align 4
2066ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    call void @__kmpc_critical(%struct.ident_t* @[[GLOB3]], i32 [[TMP29]], [8 x i32]* @.gomp_critical_user_.atomic_reduction.var)
2067ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[CALL9:%.*]] = call nonnull align 4 dereferenceable(8) %struct.Point* @_ZN5PointoRERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP1]], %struct.Point* nonnull align 4 dereferenceable(8) [[RED3]])
2068ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    call void @__kmpc_end_critical(%struct.ident_t* @[[GLOB3]], i32 [[TMP29]], [8 x i32]* @.gomp_critical_user_.atomic_reduction.var)
2069f90abac6SMike Rice // COMP-NEXT:    br label [[DOTOMP_REDUCTION_DEFAULT]]
2070f90abac6SMike Rice // COMP:       .omp.reduction.default:
2071f90abac6SMike Rice // COMP-NEXT:    br label [[OMP_PRECOND_END]]
2072f90abac6SMike Rice // COMP:       omp.precond.end:
2073f90abac6SMike Rice // COMP-NEXT:    ret void
2074f90abac6SMike Rice //
2075f90abac6SMike Rice //
2076f90abac6SMike Rice // COMP-LABEL: define {{[^@]+}}@.omp.reduction.reduction_func.8
2077f90abac6SMike Rice // COMP-SAME: (i8* [[TMP0:%.*]], i8* [[TMP1:%.*]]) #[[ATTR5]] {
2078f90abac6SMike Rice // COMP-NEXT:  entry:
2079f90abac6SMike Rice // COMP-NEXT:    [[DOTADDR:%.*]] = alloca i8*, align 8
2080f90abac6SMike Rice // COMP-NEXT:    [[DOTADDR1:%.*]] = alloca i8*, align 8
2081f90abac6SMike Rice // COMP-NEXT:    store i8* [[TMP0]], i8** [[DOTADDR]], align 8
2082f90abac6SMike Rice // COMP-NEXT:    store i8* [[TMP1]], i8** [[DOTADDR1]], align 8
2083f90abac6SMike Rice // COMP-NEXT:    [[TMP2:%.*]] = load i8*, i8** [[DOTADDR]], align 8
2084f90abac6SMike Rice // COMP-NEXT:    [[TMP3:%.*]] = bitcast i8* [[TMP2]] to [1 x i8*]*
2085f90abac6SMike Rice // COMP-NEXT:    [[TMP4:%.*]] = load i8*, i8** [[DOTADDR1]], align 8
2086f90abac6SMike Rice // COMP-NEXT:    [[TMP5:%.*]] = bitcast i8* [[TMP4]] to [1 x i8*]*
2087f90abac6SMike Rice // COMP-NEXT:    [[TMP6:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP5]], i64 0, i64 0
2088f90abac6SMike Rice // COMP-NEXT:    [[TMP7:%.*]] = load i8*, i8** [[TMP6]], align 8
2089f90abac6SMike Rice // COMP-NEXT:    [[TMP8:%.*]] = bitcast i8* [[TMP7]] to %struct.Point*
2090f90abac6SMike Rice // COMP-NEXT:    [[TMP9:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP3]], i64 0, i64 0
2091f90abac6SMike Rice // COMP-NEXT:    [[TMP10:%.*]] = load i8*, i8** [[TMP9]], align 8
2092f90abac6SMike Rice // COMP-NEXT:    [[TMP11:%.*]] = bitcast i8* [[TMP10]] to %struct.Point*
209316d03818SRoman Lebedev // COMP-NEXT:    [[CALL:%.*]] = call nonnull align 4 dereferenceable(8) %struct.Point* @_ZN5PointoRERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP11]], %struct.Point* nonnull align 4 dereferenceable(8) [[TMP8]])
2094f90abac6SMike Rice // COMP-NEXT:    ret void
2095f90abac6SMike Rice //
2096f90abac6SMike Rice //
2097f90abac6SMike Rice // COMP-LABEL: define {{[^@]+}}@.omp_outlined..9
2098ac90dfc4SGiorgis Georgakoudis // COMP-SAME: (i32* noalias [[DOTGLOBAL_TID_:%.*]], i32* noalias [[DOTBOUND_TID_:%.*]], i32* nonnull align 4 dereferenceable(4) [[N:%.*]], %struct.Point* nonnull align 4 dereferenceable(8) [[RED:%.*]], %struct.Point** nonnull align 8 dereferenceable(8) [[POINTS:%.*]]) #[[ATTR2]] {
2099f90abac6SMike Rice // COMP-NEXT:  entry:
2100f90abac6SMike Rice // COMP-NEXT:    [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
2101f90abac6SMike Rice // COMP-NEXT:    [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
2102ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[N_ADDR:%.*]] = alloca i32*, align 8
2103ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[RED_ADDR:%.*]] = alloca %struct.Point*, align 8
2104ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[POINTS_ADDR:%.*]] = alloca %struct.Point**, align 8
2105f90abac6SMike Rice // COMP-NEXT:    [[DOTOMP_IV:%.*]] = alloca i32, align 4
2106f90abac6SMike Rice // COMP-NEXT:    [[TMP:%.*]] = alloca i32, align 4
2107f90abac6SMike Rice // COMP-NEXT:    [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
2108f90abac6SMike Rice // COMP-NEXT:    [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
2109f90abac6SMike Rice // COMP-NEXT:    [[I:%.*]] = alloca i32, align 4
2110f90abac6SMike Rice // COMP-NEXT:    [[DOTOMP_LB:%.*]] = alloca i32, align 4
2111f90abac6SMike Rice // COMP-NEXT:    [[DOTOMP_UB:%.*]] = alloca i32, align 4
2112f90abac6SMike Rice // COMP-NEXT:    [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
2113f90abac6SMike Rice // COMP-NEXT:    [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
2114ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[RED3:%.*]] = alloca [[STRUCT_POINT:%.*]], align 4
2115ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[I4:%.*]] = alloca i32, align 4
2116f90abac6SMike Rice // COMP-NEXT:    [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [1 x i8*], align 8
2117f90abac6SMike Rice // COMP-NEXT:    store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
2118f90abac6SMike Rice // COMP-NEXT:    store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
2119ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store i32* [[N]], i32** [[N_ADDR]], align 8
2120ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store %struct.Point* [[RED]], %struct.Point** [[RED_ADDR]], align 8
2121ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store %struct.Point** [[POINTS]], %struct.Point*** [[POINTS_ADDR]], align 8
2122ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP0:%.*]] = load i32*, i32** [[N_ADDR]], align 8
2123ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP1:%.*]] = load %struct.Point*, %struct.Point** [[RED_ADDR]], align 8
2124ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP2:%.*]] = load %struct.Point**, %struct.Point*** [[POINTS_ADDR]], align 8
2125ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP3:%.*]] = load i32, i32* [[TMP0]], align 4
2126ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store i32 [[TMP3]], i32* [[DOTCAPTURE_EXPR_]], align 4
2127ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP4:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_]], align 4
2128ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[SUB:%.*]] = sub i32 [[TMP4]], 0
2129f90abac6SMike Rice // COMP-NEXT:    [[DIV:%.*]] = udiv i32 [[SUB]], 1
2130f90abac6SMike Rice // COMP-NEXT:    [[SUB2:%.*]] = sub i32 [[DIV]], 1
2131f90abac6SMike Rice // COMP-NEXT:    store i32 [[SUB2]], i32* [[DOTCAPTURE_EXPR_1]], align 4
2132f90abac6SMike Rice // COMP-NEXT:    store i32 0, i32* [[I]], align 4
2133ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP5:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_]], align 4
2134ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[CMP:%.*]] = icmp ult i32 0, [[TMP5]]
2135f90abac6SMike Rice // COMP-NEXT:    br i1 [[CMP]], label [[OMP_PRECOND_THEN:%.*]], label [[OMP_PRECOND_END:%.*]]
2136f90abac6SMike Rice // COMP:       omp.precond.then:
2137f90abac6SMike Rice // COMP-NEXT:    store i32 0, i32* [[DOTOMP_LB]], align 4
2138ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP6:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_1]], align 4
2139ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store i32 [[TMP6]], i32* [[DOTOMP_UB]], align 4
2140f90abac6SMike Rice // COMP-NEXT:    store i32 1, i32* [[DOTOMP_STRIDE]], align 4
2141f90abac6SMike Rice // COMP-NEXT:    store i32 0, i32* [[DOTOMP_IS_LAST]], align 4
2142ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    call void @_ZN5PointC1Ev(%struct.Point* nonnull align 4 dereferenceable(8) [[RED3]]) #[[ATTR4]]
2143ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP7:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
2144ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP8:%.*]] = load i32, i32* [[TMP7]], align 4
2145ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    call void @__kmpc_for_static_init_4u(%struct.ident_t* @[[GLOB1]], i32 [[TMP8]], i32 34, i32* [[DOTOMP_IS_LAST]], i32* [[DOTOMP_LB]], i32* [[DOTOMP_UB]], i32* [[DOTOMP_STRIDE]], i32 1, i32 1)
2146ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP9:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
2147ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP10:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_1]], align 4
2148ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[CMP5:%.*]] = icmp ugt i32 [[TMP9]], [[TMP10]]
2149ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    br i1 [[CMP5]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
2150f90abac6SMike Rice // COMP:       cond.true:
2151ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP11:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_1]], align 4
2152f90abac6SMike Rice // COMP-NEXT:    br label [[COND_END:%.*]]
2153f90abac6SMike Rice // COMP:       cond.false:
2154ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP12:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
2155f90abac6SMike Rice // COMP-NEXT:    br label [[COND_END]]
2156f90abac6SMike Rice // COMP:       cond.end:
2157ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[COND:%.*]] = phi i32 [ [[TMP11]], [[COND_TRUE]] ], [ [[TMP12]], [[COND_FALSE]] ]
2158f90abac6SMike Rice // COMP-NEXT:    store i32 [[COND]], i32* [[DOTOMP_UB]], align 4
2159ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP13:%.*]] = load i32, i32* [[DOTOMP_LB]], align 4
2160ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store i32 [[TMP13]], i32* [[DOTOMP_IV]], align 4
2161f90abac6SMike Rice // COMP-NEXT:    br label [[OMP_INNER_FOR_COND:%.*]]
2162f90abac6SMike Rice // COMP:       omp.inner.for.cond:
2163ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP14:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
2164ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP15:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
2165ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[ADD:%.*]] = add i32 [[TMP15]], 1
2166ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[CMP6:%.*]] = icmp ult i32 [[TMP14]], [[ADD]]
2167ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    br i1 [[CMP6]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
2168f90abac6SMike Rice // COMP:       omp.inner.for.body:
2169ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP16:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
2170ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[MUL:%.*]] = mul i32 [[TMP16]], 1
2171ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[ADD7:%.*]] = add i32 0, [[MUL]]
2172ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store i32 [[ADD7]], i32* [[I4]], align 4
2173ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP17:%.*]] = load i32, i32* [[I4]], align 4
2174ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP18:%.*]] = load %struct.Point*, %struct.Point** [[TMP2]], align 8
2175ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    call void @_Z4workR5PointiPKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[RED3]], i32 [[TMP17]], %struct.Point* [[TMP18]])
2176f90abac6SMike Rice // COMP-NEXT:    br label [[OMP_BODY_CONTINUE:%.*]]
2177f90abac6SMike Rice // COMP:       omp.body.continue:
2178f90abac6SMike Rice // COMP-NEXT:    br label [[OMP_INNER_FOR_INC:%.*]]
2179f90abac6SMike Rice // COMP:       omp.inner.for.inc:
2180ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP19:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
2181ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[ADD8:%.*]] = add i32 [[TMP19]], 1
2182ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store i32 [[ADD8]], i32* [[DOTOMP_IV]], align 4
2183f90abac6SMike Rice // COMP-NEXT:    br label [[OMP_INNER_FOR_COND]]
2184f90abac6SMike Rice // COMP:       omp.inner.for.end:
2185f90abac6SMike Rice // COMP-NEXT:    br label [[OMP_LOOP_EXIT:%.*]]
2186f90abac6SMike Rice // COMP:       omp.loop.exit:
2187ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP20:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
2188ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP21:%.*]] = load i32, i32* [[TMP20]], align 4
2189ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    call void @__kmpc_for_static_fini(%struct.ident_t* @[[GLOB1]], i32 [[TMP21]])
2190ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP22:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 0
2191ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP23:%.*]] = bitcast %struct.Point* [[RED3]] to i8*
2192ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store i8* [[TMP23]], i8** [[TMP22]], align 8
2193f90abac6SMike Rice // COMP-NEXT:    [[TMP24:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
2194f90abac6SMike Rice // COMP-NEXT:    [[TMP25:%.*]] = load i32, i32* [[TMP24]], align 4
2195ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP26:%.*]] = bitcast [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8*
2196ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP27:%.*]] = call i32 @__kmpc_reduce_nowait(%struct.ident_t* @[[GLOB2]], i32 [[TMP25]], i32 1, i64 8, i8* [[TMP26]], void (i8*, i8*)* @.omp.reduction.reduction_func.10, [8 x i32]* @.gomp_critical_user_.reduction.var)
2197ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    switch i32 [[TMP27]], label [[DOTOMP_REDUCTION_DEFAULT:%.*]] [
2198f90abac6SMike Rice // COMP-NEXT:    i32 1, label [[DOTOMP_REDUCTION_CASE1:%.*]]
2199f90abac6SMike Rice // COMP-NEXT:    i32 2, label [[DOTOMP_REDUCTION_CASE2:%.*]]
2200f90abac6SMike Rice // COMP-NEXT:    ]
2201f90abac6SMike Rice // COMP:       .omp.reduction.case1:
2202ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[CALL:%.*]] = call nonnull align 4 dereferenceable(8) %struct.Point* @_ZN5PointeOERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP1]], %struct.Point* nonnull align 4 dereferenceable(8) [[RED3]])
2203ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    call void @__kmpc_end_reduce_nowait(%struct.ident_t* @[[GLOB2]], i32 [[TMP25]], [8 x i32]* @.gomp_critical_user_.reduction.var)
2204f90abac6SMike Rice // COMP-NEXT:    br label [[DOTOMP_REDUCTION_DEFAULT]]
2205f90abac6SMike Rice // COMP:       .omp.reduction.case2:
2206ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP28:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
2207ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP29:%.*]] = load i32, i32* [[TMP28]], align 4
2208ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    call void @__kmpc_critical(%struct.ident_t* @[[GLOB3]], i32 [[TMP29]], [8 x i32]* @.gomp_critical_user_.atomic_reduction.var)
2209ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[CALL9:%.*]] = call nonnull align 4 dereferenceable(8) %struct.Point* @_ZN5PointeOERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP1]], %struct.Point* nonnull align 4 dereferenceable(8) [[RED3]])
2210ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    call void @__kmpc_end_critical(%struct.ident_t* @[[GLOB3]], i32 [[TMP29]], [8 x i32]* @.gomp_critical_user_.atomic_reduction.var)
2211f90abac6SMike Rice // COMP-NEXT:    br label [[DOTOMP_REDUCTION_DEFAULT]]
2212f90abac6SMike Rice // COMP:       .omp.reduction.default:
2213f90abac6SMike Rice // COMP-NEXT:    br label [[OMP_PRECOND_END]]
2214f90abac6SMike Rice // COMP:       omp.precond.end:
2215f90abac6SMike Rice // COMP-NEXT:    ret void
2216f90abac6SMike Rice //
2217f90abac6SMike Rice //
2218f90abac6SMike Rice // COMP-LABEL: define {{[^@]+}}@.omp.reduction.reduction_func.10
2219f90abac6SMike Rice // COMP-SAME: (i8* [[TMP0:%.*]], i8* [[TMP1:%.*]]) #[[ATTR5]] {
2220f90abac6SMike Rice // COMP-NEXT:  entry:
2221f90abac6SMike Rice // COMP-NEXT:    [[DOTADDR:%.*]] = alloca i8*, align 8
2222f90abac6SMike Rice // COMP-NEXT:    [[DOTADDR1:%.*]] = alloca i8*, align 8
2223f90abac6SMike Rice // COMP-NEXT:    store i8* [[TMP0]], i8** [[DOTADDR]], align 8
2224f90abac6SMike Rice // COMP-NEXT:    store i8* [[TMP1]], i8** [[DOTADDR1]], align 8
2225f90abac6SMike Rice // COMP-NEXT:    [[TMP2:%.*]] = load i8*, i8** [[DOTADDR]], align 8
2226f90abac6SMike Rice // COMP-NEXT:    [[TMP3:%.*]] = bitcast i8* [[TMP2]] to [1 x i8*]*
2227f90abac6SMike Rice // COMP-NEXT:    [[TMP4:%.*]] = load i8*, i8** [[DOTADDR1]], align 8
2228f90abac6SMike Rice // COMP-NEXT:    [[TMP5:%.*]] = bitcast i8* [[TMP4]] to [1 x i8*]*
2229f90abac6SMike Rice // COMP-NEXT:    [[TMP6:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP5]], i64 0, i64 0
2230f90abac6SMike Rice // COMP-NEXT:    [[TMP7:%.*]] = load i8*, i8** [[TMP6]], align 8
2231f90abac6SMike Rice // COMP-NEXT:    [[TMP8:%.*]] = bitcast i8* [[TMP7]] to %struct.Point*
2232f90abac6SMike Rice // COMP-NEXT:    [[TMP9:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP3]], i64 0, i64 0
2233f90abac6SMike Rice // COMP-NEXT:    [[TMP10:%.*]] = load i8*, i8** [[TMP9]], align 8
2234f90abac6SMike Rice // COMP-NEXT:    [[TMP11:%.*]] = bitcast i8* [[TMP10]] to %struct.Point*
223516d03818SRoman Lebedev // COMP-NEXT:    [[CALL:%.*]] = call nonnull align 4 dereferenceable(8) %struct.Point* @_ZN5PointeOERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP11]], %struct.Point* nonnull align 4 dereferenceable(8) [[TMP8]])
2236f90abac6SMike Rice // COMP-NEXT:    ret void
2237f90abac6SMike Rice //
2238f90abac6SMike Rice //
2239f90abac6SMike Rice // COMP-LABEL: define {{[^@]+}}@.omp_outlined..11
2240ac90dfc4SGiorgis Georgakoudis // COMP-SAME: (i32* noalias [[DOTGLOBAL_TID_:%.*]], i32* noalias [[DOTBOUND_TID_:%.*]], i32* nonnull align 4 dereferenceable(4) [[N:%.*]], %struct.Point* nonnull align 4 dereferenceable(8) [[RED:%.*]], %struct.Point** nonnull align 8 dereferenceable(8) [[POINTS:%.*]]) #[[ATTR2]] {
2241f90abac6SMike Rice // COMP-NEXT:  entry:
2242f90abac6SMike Rice // COMP-NEXT:    [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
2243f90abac6SMike Rice // COMP-NEXT:    [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
2244ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[N_ADDR:%.*]] = alloca i32*, align 8
2245ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[RED_ADDR:%.*]] = alloca %struct.Point*, align 8
2246ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[POINTS_ADDR:%.*]] = alloca %struct.Point**, align 8
2247f90abac6SMike Rice // COMP-NEXT:    [[DOTOMP_IV:%.*]] = alloca i32, align 4
2248f90abac6SMike Rice // COMP-NEXT:    [[TMP:%.*]] = alloca i32, align 4
2249f90abac6SMike Rice // COMP-NEXT:    [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
2250f90abac6SMike Rice // COMP-NEXT:    [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
2251f90abac6SMike Rice // COMP-NEXT:    [[I:%.*]] = alloca i32, align 4
2252f90abac6SMike Rice // COMP-NEXT:    [[DOTOMP_LB:%.*]] = alloca i32, align 4
2253f90abac6SMike Rice // COMP-NEXT:    [[DOTOMP_UB:%.*]] = alloca i32, align 4
2254f90abac6SMike Rice // COMP-NEXT:    [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
2255f90abac6SMike Rice // COMP-NEXT:    [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
2256ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[RED3:%.*]] = alloca [[STRUCT_POINT:%.*]], align 4
2257ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[I4:%.*]] = alloca i32, align 4
2258f90abac6SMike Rice // COMP-NEXT:    [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [1 x i8*], align 8
2259f90abac6SMike Rice // COMP-NEXT:    [[REF_TMP:%.*]] = alloca [[STRUCT_POINT]], align 4
2260ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[REF_TMP10:%.*]] = alloca [[STRUCT_POINT]], align 4
2261f90abac6SMike Rice // COMP-NEXT:    store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
2262f90abac6SMike Rice // COMP-NEXT:    store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
2263ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store i32* [[N]], i32** [[N_ADDR]], align 8
2264ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store %struct.Point* [[RED]], %struct.Point** [[RED_ADDR]], align 8
2265ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store %struct.Point** [[POINTS]], %struct.Point*** [[POINTS_ADDR]], align 8
2266ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP0:%.*]] = load i32*, i32** [[N_ADDR]], align 8
2267ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP1:%.*]] = load %struct.Point*, %struct.Point** [[RED_ADDR]], align 8
2268ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP2:%.*]] = load %struct.Point**, %struct.Point*** [[POINTS_ADDR]], align 8
2269ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP3:%.*]] = load i32, i32* [[TMP0]], align 4
2270ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store i32 [[TMP3]], i32* [[DOTCAPTURE_EXPR_]], align 4
2271ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP4:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_]], align 4
2272ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[SUB:%.*]] = sub i32 [[TMP4]], 0
2273f90abac6SMike Rice // COMP-NEXT:    [[DIV:%.*]] = udiv i32 [[SUB]], 1
2274f90abac6SMike Rice // COMP-NEXT:    [[SUB2:%.*]] = sub i32 [[DIV]], 1
2275f90abac6SMike Rice // COMP-NEXT:    store i32 [[SUB2]], i32* [[DOTCAPTURE_EXPR_1]], align 4
2276f90abac6SMike Rice // COMP-NEXT:    store i32 0, i32* [[I]], align 4
2277ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP5:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_]], align 4
2278ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[CMP:%.*]] = icmp ult i32 0, [[TMP5]]
2279f90abac6SMike Rice // COMP-NEXT:    br i1 [[CMP]], label [[OMP_PRECOND_THEN:%.*]], label [[OMP_PRECOND_END:%.*]]
2280f90abac6SMike Rice // COMP:       omp.precond.then:
2281f90abac6SMike Rice // COMP-NEXT:    store i32 0, i32* [[DOTOMP_LB]], align 4
2282ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP6:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_1]], align 4
2283ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store i32 [[TMP6]], i32* [[DOTOMP_UB]], align 4
2284f90abac6SMike Rice // COMP-NEXT:    store i32 1, i32* [[DOTOMP_STRIDE]], align 4
2285f90abac6SMike Rice // COMP-NEXT:    store i32 0, i32* [[DOTOMP_IS_LAST]], align 4
2286ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    call void @_ZN5PointC1Ev(%struct.Point* nonnull align 4 dereferenceable(8) [[RED3]]) #[[ATTR4]]
2287ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP7:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
2288ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP8:%.*]] = load i32, i32* [[TMP7]], align 4
2289ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    call void @__kmpc_for_static_init_4u(%struct.ident_t* @[[GLOB1]], i32 [[TMP8]], i32 34, i32* [[DOTOMP_IS_LAST]], i32* [[DOTOMP_LB]], i32* [[DOTOMP_UB]], i32* [[DOTOMP_STRIDE]], i32 1, i32 1)
2290ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP9:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
2291ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP10:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_1]], align 4
2292ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[CMP5:%.*]] = icmp ugt i32 [[TMP9]], [[TMP10]]
2293ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    br i1 [[CMP5]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
2294f90abac6SMike Rice // COMP:       cond.true:
2295ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP11:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_1]], align 4
2296f90abac6SMike Rice // COMP-NEXT:    br label [[COND_END:%.*]]
2297f90abac6SMike Rice // COMP:       cond.false:
2298ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP12:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
2299f90abac6SMike Rice // COMP-NEXT:    br label [[COND_END]]
2300f90abac6SMike Rice // COMP:       cond.end:
2301ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[COND:%.*]] = phi i32 [ [[TMP11]], [[COND_TRUE]] ], [ [[TMP12]], [[COND_FALSE]] ]
2302f90abac6SMike Rice // COMP-NEXT:    store i32 [[COND]], i32* [[DOTOMP_UB]], align 4
2303ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP13:%.*]] = load i32, i32* [[DOTOMP_LB]], align 4
2304ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store i32 [[TMP13]], i32* [[DOTOMP_IV]], align 4
2305f90abac6SMike Rice // COMP-NEXT:    br label [[OMP_INNER_FOR_COND:%.*]]
2306f90abac6SMike Rice // COMP:       omp.inner.for.cond:
2307ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP14:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
2308ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP15:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
2309ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[ADD:%.*]] = add i32 [[TMP15]], 1
2310ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[CMP6:%.*]] = icmp ult i32 [[TMP14]], [[ADD]]
2311ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    br i1 [[CMP6]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
2312f90abac6SMike Rice // COMP:       omp.inner.for.body:
2313ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP16:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
2314ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[MUL:%.*]] = mul i32 [[TMP16]], 1
2315ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[ADD7:%.*]] = add i32 0, [[MUL]]
2316ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store i32 [[ADD7]], i32* [[I4]], align 4
2317ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP17:%.*]] = load i32, i32* [[I4]], align 4
2318ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP18:%.*]] = load %struct.Point*, %struct.Point** [[TMP2]], align 8
2319ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    call void @_Z4workR5PointiPKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[RED3]], i32 [[TMP17]], %struct.Point* [[TMP18]])
2320f90abac6SMike Rice // COMP-NEXT:    br label [[OMP_BODY_CONTINUE:%.*]]
2321f90abac6SMike Rice // COMP:       omp.body.continue:
2322f90abac6SMike Rice // COMP-NEXT:    br label [[OMP_INNER_FOR_INC:%.*]]
2323f90abac6SMike Rice // COMP:       omp.inner.for.inc:
2324ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP19:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
2325ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[ADD8:%.*]] = add i32 [[TMP19]], 1
2326ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store i32 [[ADD8]], i32* [[DOTOMP_IV]], align 4
2327f90abac6SMike Rice // COMP-NEXT:    br label [[OMP_INNER_FOR_COND]]
2328f90abac6SMike Rice // COMP:       omp.inner.for.end:
2329f90abac6SMike Rice // COMP-NEXT:    br label [[OMP_LOOP_EXIT:%.*]]
2330f90abac6SMike Rice // COMP:       omp.loop.exit:
2331ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP20:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
2332ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP21:%.*]] = load i32, i32* [[TMP20]], align 4
2333ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    call void @__kmpc_for_static_fini(%struct.ident_t* @[[GLOB1]], i32 [[TMP21]])
2334ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP22:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 0
2335ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP23:%.*]] = bitcast %struct.Point* [[RED3]] to i8*
2336ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store i8* [[TMP23]], i8** [[TMP22]], align 8
2337f90abac6SMike Rice // COMP-NEXT:    [[TMP24:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
2338f90abac6SMike Rice // COMP-NEXT:    [[TMP25:%.*]] = load i32, i32* [[TMP24]], align 4
2339ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP26:%.*]] = bitcast [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8*
2340ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP27:%.*]] = call i32 @__kmpc_reduce_nowait(%struct.ident_t* @[[GLOB2]], i32 [[TMP25]], i32 1, i64 8, i8* [[TMP26]], void (i8*, i8*)* @.omp.reduction.reduction_func.12, [8 x i32]* @.gomp_critical_user_.reduction.var)
2341ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    switch i32 [[TMP27]], label [[DOTOMP_REDUCTION_DEFAULT:%.*]] [
2342f90abac6SMike Rice // COMP-NEXT:    i32 1, label [[DOTOMP_REDUCTION_CASE1:%.*]]
2343f90abac6SMike Rice // COMP-NEXT:    i32 2, label [[DOTOMP_REDUCTION_CASE2:%.*]]
2344f90abac6SMike Rice // COMP-NEXT:    ]
2345f90abac6SMike Rice // COMP:       .omp.reduction.case1:
2346ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[CALL:%.*]] = call i64 @_ZNK5PointaaERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP1]], %struct.Point* nonnull align 4 dereferenceable(8) [[RED3]])
2347ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP28:%.*]] = bitcast %struct.Point* [[REF_TMP]] to i64*
2348ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store i64 [[CALL]], i64* [[TMP28]], align 4
2349ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[CALL9:%.*]] = call nonnull align 4 dereferenceable(8) %struct.Point* @_ZN5PointaSERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP1]], %struct.Point* nonnull align 4 dereferenceable(8) [[REF_TMP]])
2350ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    call void @__kmpc_end_reduce_nowait(%struct.ident_t* @[[GLOB2]], i32 [[TMP25]], [8 x i32]* @.gomp_critical_user_.reduction.var)
2351f90abac6SMike Rice // COMP-NEXT:    br label [[DOTOMP_REDUCTION_DEFAULT]]
2352f90abac6SMike Rice // COMP:       .omp.reduction.case2:
2353ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP29:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
2354ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP30:%.*]] = load i32, i32* [[TMP29]], align 4
2355ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    call void @__kmpc_critical(%struct.ident_t* @[[GLOB3]], i32 [[TMP30]], [8 x i32]* @.gomp_critical_user_.atomic_reduction.var)
2356ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[CALL11:%.*]] = call i64 @_ZNK5PointaaERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP1]], %struct.Point* nonnull align 4 dereferenceable(8) [[RED3]])
2357ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP31:%.*]] = bitcast %struct.Point* [[REF_TMP10]] to i64*
2358ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store i64 [[CALL11]], i64* [[TMP31]], align 4
2359ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[CALL12:%.*]] = call nonnull align 4 dereferenceable(8) %struct.Point* @_ZN5PointaSERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP1]], %struct.Point* nonnull align 4 dereferenceable(8) [[REF_TMP10]])
2360ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    call void @__kmpc_end_critical(%struct.ident_t* @[[GLOB3]], i32 [[TMP30]], [8 x i32]* @.gomp_critical_user_.atomic_reduction.var)
2361f90abac6SMike Rice // COMP-NEXT:    br label [[DOTOMP_REDUCTION_DEFAULT]]
2362f90abac6SMike Rice // COMP:       .omp.reduction.default:
2363f90abac6SMike Rice // COMP-NEXT:    br label [[OMP_PRECOND_END]]
2364f90abac6SMike Rice // COMP:       omp.precond.end:
2365f90abac6SMike Rice // COMP-NEXT:    ret void
2366f90abac6SMike Rice //
2367f90abac6SMike Rice //
2368f90abac6SMike Rice // COMP-LABEL: define {{[^@]+}}@.omp.reduction.reduction_func.12
2369f90abac6SMike Rice // COMP-SAME: (i8* [[TMP0:%.*]], i8* [[TMP1:%.*]]) #[[ATTR5]] {
2370f90abac6SMike Rice // COMP-NEXT:  entry:
2371f90abac6SMike Rice // COMP-NEXT:    [[DOTADDR:%.*]] = alloca i8*, align 8
2372f90abac6SMike Rice // COMP-NEXT:    [[DOTADDR1:%.*]] = alloca i8*, align 8
2373f90abac6SMike Rice // COMP-NEXT:    [[REF_TMP:%.*]] = alloca [[STRUCT_POINT:%.*]], align 4
2374f90abac6SMike Rice // COMP-NEXT:    store i8* [[TMP0]], i8** [[DOTADDR]], align 8
2375f90abac6SMike Rice // COMP-NEXT:    store i8* [[TMP1]], i8** [[DOTADDR1]], align 8
2376f90abac6SMike Rice // COMP-NEXT:    [[TMP2:%.*]] = load i8*, i8** [[DOTADDR]], align 8
2377f90abac6SMike Rice // COMP-NEXT:    [[TMP3:%.*]] = bitcast i8* [[TMP2]] to [1 x i8*]*
2378f90abac6SMike Rice // COMP-NEXT:    [[TMP4:%.*]] = load i8*, i8** [[DOTADDR1]], align 8
2379f90abac6SMike Rice // COMP-NEXT:    [[TMP5:%.*]] = bitcast i8* [[TMP4]] to [1 x i8*]*
2380f90abac6SMike Rice // COMP-NEXT:    [[TMP6:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP5]], i64 0, i64 0
2381f90abac6SMike Rice // COMP-NEXT:    [[TMP7:%.*]] = load i8*, i8** [[TMP6]], align 8
2382f90abac6SMike Rice // COMP-NEXT:    [[TMP8:%.*]] = bitcast i8* [[TMP7]] to %struct.Point*
2383f90abac6SMike Rice // COMP-NEXT:    [[TMP9:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP3]], i64 0, i64 0
2384f90abac6SMike Rice // COMP-NEXT:    [[TMP10:%.*]] = load i8*, i8** [[TMP9]], align 8
2385f90abac6SMike Rice // COMP-NEXT:    [[TMP11:%.*]] = bitcast i8* [[TMP10]] to %struct.Point*
238616d03818SRoman Lebedev // COMP-NEXT:    [[CALL:%.*]] = call i64 @_ZNK5PointaaERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP11]], %struct.Point* nonnull align 4 dereferenceable(8) [[TMP8]])
2387f90abac6SMike Rice // COMP-NEXT:    [[TMP12:%.*]] = bitcast %struct.Point* [[REF_TMP]] to i64*
2388f90abac6SMike Rice // COMP-NEXT:    store i64 [[CALL]], i64* [[TMP12]], align 4
238916d03818SRoman Lebedev // COMP-NEXT:    [[CALL2:%.*]] = call nonnull align 4 dereferenceable(8) %struct.Point* @_ZN5PointaSERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP11]], %struct.Point* nonnull align 4 dereferenceable(8) [[REF_TMP]])
2390f90abac6SMike Rice // COMP-NEXT:    ret void
2391f90abac6SMike Rice //
2392f90abac6SMike Rice //
2393f90abac6SMike Rice // COMP-LABEL: define {{[^@]+}}@.omp_outlined..13
2394ac90dfc4SGiorgis Georgakoudis // COMP-SAME: (i32* noalias [[DOTGLOBAL_TID_:%.*]], i32* noalias [[DOTBOUND_TID_:%.*]], i32* nonnull align 4 dereferenceable(4) [[N:%.*]], %struct.Point* nonnull align 4 dereferenceable(8) [[RED:%.*]], %struct.Point** nonnull align 8 dereferenceable(8) [[POINTS:%.*]]) #[[ATTR2]] {
2395f90abac6SMike Rice // COMP-NEXT:  entry:
2396f90abac6SMike Rice // COMP-NEXT:    [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
2397f90abac6SMike Rice // COMP-NEXT:    [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
2398ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[N_ADDR:%.*]] = alloca i32*, align 8
2399ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[RED_ADDR:%.*]] = alloca %struct.Point*, align 8
2400ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[POINTS_ADDR:%.*]] = alloca %struct.Point**, align 8
2401f90abac6SMike Rice // COMP-NEXT:    [[DOTOMP_IV:%.*]] = alloca i32, align 4
2402f90abac6SMike Rice // COMP-NEXT:    [[TMP:%.*]] = alloca i32, align 4
2403f90abac6SMike Rice // COMP-NEXT:    [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
2404f90abac6SMike Rice // COMP-NEXT:    [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
2405f90abac6SMike Rice // COMP-NEXT:    [[I:%.*]] = alloca i32, align 4
2406f90abac6SMike Rice // COMP-NEXT:    [[DOTOMP_LB:%.*]] = alloca i32, align 4
2407f90abac6SMike Rice // COMP-NEXT:    [[DOTOMP_UB:%.*]] = alloca i32, align 4
2408f90abac6SMike Rice // COMP-NEXT:    [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
2409f90abac6SMike Rice // COMP-NEXT:    [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
2410ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[RED3:%.*]] = alloca [[STRUCT_POINT:%.*]], align 4
2411ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[I4:%.*]] = alloca i32, align 4
2412f90abac6SMike Rice // COMP-NEXT:    [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [1 x i8*], align 8
2413f90abac6SMike Rice // COMP-NEXT:    [[REF_TMP:%.*]] = alloca [[STRUCT_POINT]], align 4
2414ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[REF_TMP10:%.*]] = alloca [[STRUCT_POINT]], align 4
2415f90abac6SMike Rice // COMP-NEXT:    store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
2416f90abac6SMike Rice // COMP-NEXT:    store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
2417ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store i32* [[N]], i32** [[N_ADDR]], align 8
2418ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store %struct.Point* [[RED]], %struct.Point** [[RED_ADDR]], align 8
2419ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store %struct.Point** [[POINTS]], %struct.Point*** [[POINTS_ADDR]], align 8
2420ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP0:%.*]] = load i32*, i32** [[N_ADDR]], align 8
2421ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP1:%.*]] = load %struct.Point*, %struct.Point** [[RED_ADDR]], align 8
2422ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP2:%.*]] = load %struct.Point**, %struct.Point*** [[POINTS_ADDR]], align 8
2423ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP3:%.*]] = load i32, i32* [[TMP0]], align 4
2424ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store i32 [[TMP3]], i32* [[DOTCAPTURE_EXPR_]], align 4
2425ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP4:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_]], align 4
2426ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[SUB:%.*]] = sub i32 [[TMP4]], 0
2427f90abac6SMike Rice // COMP-NEXT:    [[DIV:%.*]] = udiv i32 [[SUB]], 1
2428f90abac6SMike Rice // COMP-NEXT:    [[SUB2:%.*]] = sub i32 [[DIV]], 1
2429f90abac6SMike Rice // COMP-NEXT:    store i32 [[SUB2]], i32* [[DOTCAPTURE_EXPR_1]], align 4
2430f90abac6SMike Rice // COMP-NEXT:    store i32 0, i32* [[I]], align 4
2431ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP5:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_]], align 4
2432ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[CMP:%.*]] = icmp ult i32 0, [[TMP5]]
2433f90abac6SMike Rice // COMP-NEXT:    br i1 [[CMP]], label [[OMP_PRECOND_THEN:%.*]], label [[OMP_PRECOND_END:%.*]]
2434f90abac6SMike Rice // COMP:       omp.precond.then:
2435f90abac6SMike Rice // COMP-NEXT:    store i32 0, i32* [[DOTOMP_LB]], align 4
2436ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP6:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_1]], align 4
2437ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store i32 [[TMP6]], i32* [[DOTOMP_UB]], align 4
2438f90abac6SMike Rice // COMP-NEXT:    store i32 1, i32* [[DOTOMP_STRIDE]], align 4
2439f90abac6SMike Rice // COMP-NEXT:    store i32 0, i32* [[DOTOMP_IS_LAST]], align 4
2440ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    call void @_ZN5PointC1Ev(%struct.Point* nonnull align 4 dereferenceable(8) [[RED3]]) #[[ATTR4]]
2441ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP7:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
2442ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP8:%.*]] = load i32, i32* [[TMP7]], align 4
2443ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    call void @__kmpc_for_static_init_4u(%struct.ident_t* @[[GLOB1]], i32 [[TMP8]], i32 34, i32* [[DOTOMP_IS_LAST]], i32* [[DOTOMP_LB]], i32* [[DOTOMP_UB]], i32* [[DOTOMP_STRIDE]], i32 1, i32 1)
2444ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP9:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
2445ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP10:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_1]], align 4
2446ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[CMP5:%.*]] = icmp ugt i32 [[TMP9]], [[TMP10]]
2447ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    br i1 [[CMP5]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
2448f90abac6SMike Rice // COMP:       cond.true:
2449ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP11:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_1]], align 4
2450f90abac6SMike Rice // COMP-NEXT:    br label [[COND_END:%.*]]
2451f90abac6SMike Rice // COMP:       cond.false:
2452ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP12:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
2453f90abac6SMike Rice // COMP-NEXT:    br label [[COND_END]]
2454f90abac6SMike Rice // COMP:       cond.end:
2455ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[COND:%.*]] = phi i32 [ [[TMP11]], [[COND_TRUE]] ], [ [[TMP12]], [[COND_FALSE]] ]
2456f90abac6SMike Rice // COMP-NEXT:    store i32 [[COND]], i32* [[DOTOMP_UB]], align 4
2457ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP13:%.*]] = load i32, i32* [[DOTOMP_LB]], align 4
2458ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store i32 [[TMP13]], i32* [[DOTOMP_IV]], align 4
2459f90abac6SMike Rice // COMP-NEXT:    br label [[OMP_INNER_FOR_COND:%.*]]
2460f90abac6SMike Rice // COMP:       omp.inner.for.cond:
2461ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP14:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
2462ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP15:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
2463ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[ADD:%.*]] = add i32 [[TMP15]], 1
2464ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[CMP6:%.*]] = icmp ult i32 [[TMP14]], [[ADD]]
2465ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    br i1 [[CMP6]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
2466f90abac6SMike Rice // COMP:       omp.inner.for.body:
2467ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP16:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
2468ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[MUL:%.*]] = mul i32 [[TMP16]], 1
2469ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[ADD7:%.*]] = add i32 0, [[MUL]]
2470ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store i32 [[ADD7]], i32* [[I4]], align 4
2471ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP17:%.*]] = load i32, i32* [[I4]], align 4
2472ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP18:%.*]] = load %struct.Point*, %struct.Point** [[TMP2]], align 8
2473ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    call void @_Z4workR5PointiPKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[RED3]], i32 [[TMP17]], %struct.Point* [[TMP18]])
2474f90abac6SMike Rice // COMP-NEXT:    br label [[OMP_BODY_CONTINUE:%.*]]
2475f90abac6SMike Rice // COMP:       omp.body.continue:
2476f90abac6SMike Rice // COMP-NEXT:    br label [[OMP_INNER_FOR_INC:%.*]]
2477f90abac6SMike Rice // COMP:       omp.inner.for.inc:
2478ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP19:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
2479ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[ADD8:%.*]] = add i32 [[TMP19]], 1
2480ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store i32 [[ADD8]], i32* [[DOTOMP_IV]], align 4
2481f90abac6SMike Rice // COMP-NEXT:    br label [[OMP_INNER_FOR_COND]]
2482f90abac6SMike Rice // COMP:       omp.inner.for.end:
2483f90abac6SMike Rice // COMP-NEXT:    br label [[OMP_LOOP_EXIT:%.*]]
2484f90abac6SMike Rice // COMP:       omp.loop.exit:
2485ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP20:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
2486ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP21:%.*]] = load i32, i32* [[TMP20]], align 4
2487ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    call void @__kmpc_for_static_fini(%struct.ident_t* @[[GLOB1]], i32 [[TMP21]])
2488ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP22:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 0
2489ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP23:%.*]] = bitcast %struct.Point* [[RED3]] to i8*
2490ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store i8* [[TMP23]], i8** [[TMP22]], align 8
2491f90abac6SMike Rice // COMP-NEXT:    [[TMP24:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
2492f90abac6SMike Rice // COMP-NEXT:    [[TMP25:%.*]] = load i32, i32* [[TMP24]], align 4
2493ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP26:%.*]] = bitcast [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8*
2494ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP27:%.*]] = call i32 @__kmpc_reduce_nowait(%struct.ident_t* @[[GLOB2]], i32 [[TMP25]], i32 1, i64 8, i8* [[TMP26]], void (i8*, i8*)* @.omp.reduction.reduction_func.14, [8 x i32]* @.gomp_critical_user_.reduction.var)
2495ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    switch i32 [[TMP27]], label [[DOTOMP_REDUCTION_DEFAULT:%.*]] [
2496f90abac6SMike Rice // COMP-NEXT:    i32 1, label [[DOTOMP_REDUCTION_CASE1:%.*]]
2497f90abac6SMike Rice // COMP-NEXT:    i32 2, label [[DOTOMP_REDUCTION_CASE2:%.*]]
2498f90abac6SMike Rice // COMP-NEXT:    ]
2499f90abac6SMike Rice // COMP:       .omp.reduction.case1:
2500ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[CALL:%.*]] = call i64 @_ZNK5PointooERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP1]], %struct.Point* nonnull align 4 dereferenceable(8) [[RED3]])
2501ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP28:%.*]] = bitcast %struct.Point* [[REF_TMP]] to i64*
2502ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store i64 [[CALL]], i64* [[TMP28]], align 4
2503ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[CALL9:%.*]] = call nonnull align 4 dereferenceable(8) %struct.Point* @_ZN5PointaSERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP1]], %struct.Point* nonnull align 4 dereferenceable(8) [[REF_TMP]])
2504ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    call void @__kmpc_end_reduce_nowait(%struct.ident_t* @[[GLOB2]], i32 [[TMP25]], [8 x i32]* @.gomp_critical_user_.reduction.var)
2505f90abac6SMike Rice // COMP-NEXT:    br label [[DOTOMP_REDUCTION_DEFAULT]]
2506f90abac6SMike Rice // COMP:       .omp.reduction.case2:
2507ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP29:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
2508ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP30:%.*]] = load i32, i32* [[TMP29]], align 4
2509ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    call void @__kmpc_critical(%struct.ident_t* @[[GLOB3]], i32 [[TMP30]], [8 x i32]* @.gomp_critical_user_.atomic_reduction.var)
2510ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[CALL11:%.*]] = call i64 @_ZNK5PointooERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP1]], %struct.Point* nonnull align 4 dereferenceable(8) [[RED3]])
2511ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[TMP31:%.*]] = bitcast %struct.Point* [[REF_TMP10]] to i64*
2512ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    store i64 [[CALL11]], i64* [[TMP31]], align 4
2513ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    [[CALL12:%.*]] = call nonnull align 4 dereferenceable(8) %struct.Point* @_ZN5PointaSERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP1]], %struct.Point* nonnull align 4 dereferenceable(8) [[REF_TMP10]])
2514ac90dfc4SGiorgis Georgakoudis // COMP-NEXT:    call void @__kmpc_end_critical(%struct.ident_t* @[[GLOB3]], i32 [[TMP30]], [8 x i32]* @.gomp_critical_user_.atomic_reduction.var)
2515f90abac6SMike Rice // COMP-NEXT:    br label [[DOTOMP_REDUCTION_DEFAULT]]
2516f90abac6SMike Rice // COMP:       .omp.reduction.default:
2517f90abac6SMike Rice // COMP-NEXT:    br label [[OMP_PRECOND_END]]
2518f90abac6SMike Rice // COMP:       omp.precond.end:
2519f90abac6SMike Rice // COMP-NEXT:    ret void
2520f90abac6SMike Rice //
2521f90abac6SMike Rice //
2522f90abac6SMike Rice // COMP-LABEL: define {{[^@]+}}@.omp.reduction.reduction_func.14
2523f90abac6SMike Rice // COMP-SAME: (i8* [[TMP0:%.*]], i8* [[TMP1:%.*]]) #[[ATTR5]] {
2524f90abac6SMike Rice // COMP-NEXT:  entry:
2525f90abac6SMike Rice // COMP-NEXT:    [[DOTADDR:%.*]] = alloca i8*, align 8
2526f90abac6SMike Rice // COMP-NEXT:    [[DOTADDR1:%.*]] = alloca i8*, align 8
2527f90abac6SMike Rice // COMP-NEXT:    [[REF_TMP:%.*]] = alloca [[STRUCT_POINT:%.*]], align 4
2528f90abac6SMike Rice // COMP-NEXT:    store i8* [[TMP0]], i8** [[DOTADDR]], align 8
2529f90abac6SMike Rice // COMP-NEXT:    store i8* [[TMP1]], i8** [[DOTADDR1]], align 8
2530f90abac6SMike Rice // COMP-NEXT:    [[TMP2:%.*]] = load i8*, i8** [[DOTADDR]], align 8
2531f90abac6SMike Rice // COMP-NEXT:    [[TMP3:%.*]] = bitcast i8* [[TMP2]] to [1 x i8*]*
2532f90abac6SMike Rice // COMP-NEXT:    [[TMP4:%.*]] = load i8*, i8** [[DOTADDR1]], align 8
2533f90abac6SMike Rice // COMP-NEXT:    [[TMP5:%.*]] = bitcast i8* [[TMP4]] to [1 x i8*]*
2534f90abac6SMike Rice // COMP-NEXT:    [[TMP6:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP5]], i64 0, i64 0
2535f90abac6SMike Rice // COMP-NEXT:    [[TMP7:%.*]] = load i8*, i8** [[TMP6]], align 8
2536f90abac6SMike Rice // COMP-NEXT:    [[TMP8:%.*]] = bitcast i8* [[TMP7]] to %struct.Point*
2537f90abac6SMike Rice // COMP-NEXT:    [[TMP9:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP3]], i64 0, i64 0
2538f90abac6SMike Rice // COMP-NEXT:    [[TMP10:%.*]] = load i8*, i8** [[TMP9]], align 8
2539f90abac6SMike Rice // COMP-NEXT:    [[TMP11:%.*]] = bitcast i8* [[TMP10]] to %struct.Point*
254016d03818SRoman Lebedev // COMP-NEXT:    [[CALL:%.*]] = call i64 @_ZNK5PointooERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP11]], %struct.Point* nonnull align 4 dereferenceable(8) [[TMP8]])
2541f90abac6SMike Rice // COMP-NEXT:    [[TMP12:%.*]] = bitcast %struct.Point* [[REF_TMP]] to i64*
2542f90abac6SMike Rice // COMP-NEXT:    store i64 [[CALL]], i64* [[TMP12]], align 4
254316d03818SRoman Lebedev // COMP-NEXT:    [[CALL2:%.*]] = call nonnull align 4 dereferenceable(8) %struct.Point* @_ZN5PointaSERKS_(%struct.Point* nonnull align 4 dereferenceable(8) [[TMP11]], %struct.Point* nonnull align 4 dereferenceable(8) [[REF_TMP]])
2544f90abac6SMike Rice // COMP-NEXT:    ret void
2545f90abac6SMike Rice //
2546f90abac6SMike Rice //
2547f90abac6SMike Rice // COMP-LABEL: define {{[^@]+}}@_ZN5PointC2Ev
254816d03818SRoman Lebedev // COMP-SAME: (%struct.Point* nonnull align 4 dereferenceable(8) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
2549f90abac6SMike Rice // COMP-NEXT:  entry:
2550f90abac6SMike Rice // COMP-NEXT:    [[THIS_ADDR:%.*]] = alloca %struct.Point*, align 8
2551f90abac6SMike Rice // COMP-NEXT:    store %struct.Point* [[THIS]], %struct.Point** [[THIS_ADDR]], align 8
2552f90abac6SMike Rice // COMP-NEXT:    [[THIS1:%.*]] = load %struct.Point*, %struct.Point** [[THIS_ADDR]], align 8
2553f90abac6SMike Rice // COMP-NEXT:    [[X:%.*]] = getelementptr inbounds [[STRUCT_POINT:%.*]], %struct.Point* [[THIS1]], i32 0, i32 0
2554f90abac6SMike Rice // COMP-NEXT:    store i32 0, i32* [[X]], align 4
2555f90abac6SMike Rice // COMP-NEXT:    [[Y:%.*]] = getelementptr inbounds [[STRUCT_POINT]], %struct.Point* [[THIS1]], i32 0, i32 1
2556f90abac6SMike Rice // COMP-NEXT:    store i32 0, i32* [[Y]], align 4
2557f90abac6SMike Rice // COMP-NEXT:    ret void
2558f90abac6SMike Rice //
2559