diff options
| author | Alexey Bataev <a.bataev@hotmail.com> | 2015-09-10 08:12:02 +0000 |
|---|---|---|
| committer | Alexey Bataev <a.bataev@hotmail.com> | 2015-09-10 08:12:02 +0000 |
| commit | 2377fe95c6beeba5cbba356fee7fba32257bbce2 (patch) | |
| tree | b853c3ba0847ca5371ae261d956726aa9d99223e /clang/test/OpenMP/parallel_for_simd_codegen.cpp | |
| parent | f054eca167ea834a168704ff7065a149d75e8f0f (diff) | |
| download | bcm5719-llvm-2377fe95c6beeba5cbba356fee7fba32257bbce2.tar.gz bcm5719-llvm-2377fe95c6beeba5cbba356fee7fba32257bbce2.zip | |
[OPENMP] Outlined function for parallel and other regions with list of captured variables.
Currently all variables used in OpenMP regions are captured into a record and passed to outlined functions in this record. It may result in some poor performance because of too complex analysis later in optimization passes. Patch makes to emit outlined functions for parallel-based regions with a list of captured variables. It reduces code for 2*n GEPs, stores and loads at least.
Codegen for task-based regions remains unchanged because runtime requires that all captured variables are passed in captured record.
llvm-svn: 247251
Diffstat (limited to 'clang/test/OpenMP/parallel_for_simd_codegen.cpp')
| -rw-r--r-- | clang/test/OpenMP/parallel_for_simd_codegen.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/clang/test/OpenMP/parallel_for_simd_codegen.cpp b/clang/test/OpenMP/parallel_for_simd_codegen.cpp index eb1e493230e..4383c0a5b4c 100644 --- a/clang/test/OpenMP/parallel_for_simd_codegen.cpp +++ b/clang/test/OpenMP/parallel_for_simd_codegen.cpp @@ -119,14 +119,13 @@ void simple(float *a, float *b, float *c, float *d) { // Init linear private var. // CHECK: [[LIN_VAR:%.+]] = load i32*, i32** % -// CHECK-NEXT: [[LIN_LOAD:%.+]] = load i32, i32* [[LIN_VAR]] +// CHECK: [[LIN_LOAD:%.+]] = load i32, i32* [[LIN_VAR]] // CHECK-NEXT: store i32 [[LIN_LOAD]], i32* [[LIN_START:%[^,]+]] // Remember linear step. // CHECK: [[CALL_VAL:%.+]] = invoke // CHECK: store i64 [[CALL_VAL]], i64* [[LIN_STEP:%[^,]+]] -// CHECK: [[GLIN_VAR:%.+]] = load double**, double*** % -// CHECK-NEXT: [[GLIN_LOAD:%.+]] = load double*, double** [[GLIN_VAR]] +// CHECK: [[GLIN_LOAD:%.+]] = load double*, double** [[GLIN_VAR:%.+]], // CHECK-NEXT: store double* [[GLIN_LOAD]], double** [[GLIN_START:%[^,]+]] // CHECK: call void @__kmpc_for_static_init_8u(%ident_t* {{[^,]+}}, i32 %{{[^,]+}}, i32 34, i32* %{{[^,]+}}, i64* [[LB:%[^,]+]], i64* [[UB:%[^,]+]], i64* [[STRIDE:%[^,]+]], i64 1, i64 1) @@ -179,11 +178,9 @@ void simple(float *a, float *b, float *c, float *d) { // CHECK: call void @__kmpc_for_static_fini(%ident_t* {{.+}}, i32 %{{.+}}) // // Linear start and step are used to calculate final value of the linear variables. -// CHECK: [[LIN_VAR:%.+]] = load i32*, i32** % // CHECK: [[LINSTART:.+]] = load i32, i32* [[LIN_START]] // CHECK: [[LINSTEP:.+]] = load i64, i64* [[LIN_STEP]] // CHECK: store i32 {{.+}}, i32* [[LIN_VAR]], -// CHECK: [[GLIN_VAR:%.+]] = load double**, double*** % // CHECK: [[GLINSTART:.+]] = load double*, double** [[GLIN_START]] // CHECK: store double* {{.*}}[[GLIN_VAR]] // CHECK: call void @__kmpc_barrier(%ident_t* {{.+}}, i32 %{{.+}}) |

