
The default version of OpenMP is updated from 5.0 to 5.1 which means if -fopenmp is specified but -fopenmp-version is not specified with clang, the default version of OpenMP is taken to be 5.1. After modifying the Frontend for that, various LIT tests were updated. This patch contains all such changes. At a high level, these are the patterns of changes observed in LIT tests - # RUN lines which mentioned `-fopenmp-version=50` need to kept only if the IR for version 5.0 and 5.1 are different. Otherwise only one RUN line with no version info(i.e. default version) needs to be there. # Test cases of this sort already had the RUN lines with respect to the older default version 5.0 and the version 5.1. Only swapping the version specification flag `-fopenmp-version` from newer version RUN line to older version RUN line is required. # Diagnostics: Remove the 5.0 version specific RUN lines if there was no difference in the Diagnostics messages with respect to the default 5.1. # Diagnostics: In case there was any difference in diagnostics messages between 5.0 and 5.1, mention version specific messages in tests. # If the test contained version specific ifdef's e.g. "#ifdef OMP5" but there were no RUN lines for any other version than 5.X, then bring the code guarded by ifdef's outside and remove the ifdef's. # Some tests had RUN lines for both 5.0 and 5.1 versions, but it is found that the IR for 5.0 is not different from the 5.1, therefore such RUN lines are redundant. So, such duplicated lines are removed. # To generate CHECK lines automatically, use the script llvm/utils/update_cc_test_checks.py Reviewed By: saiislam, ABataev Differential Revision: https://reviews.llvm.org/D129635 (cherry picked from commit 9dd2999907dc791136a75238a6000f69bf67cf4e)
92 lines
5.6 KiB
C++
92 lines
5.6 KiB
C++
// expected-no-diagnostics
|
|
#ifndef HEADER
|
|
#define HEADER
|
|
|
|
///==========================================================================///
|
|
// RUN: %clang_cc1 -DCK32 -verify -fopenmp -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck %s --check-prefix CK32 --check-prefix CK32-64
|
|
// RUN: %clang_cc1 -DCK32 -fopenmp -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
|
|
// RUN: %clang_cc1 -fopenmp -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix CK32 --check-prefix CK32-64
|
|
// RUN: %clang_cc1 -DCK32 -verify -fopenmp -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck %s --check-prefix CK32 --check-prefix CK32-32
|
|
// RUN: %clang_cc1 -DCK32 -fopenmp -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
|
|
// RUN: %clang_cc1 -fopenmp -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix CK32 --check-prefix CK32-32
|
|
|
|
// RUN: %clang_cc1 -DCK32 -verify -fopenmp-simd -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY32 %s
|
|
// RUN: %clang_cc1 -DCK32 -fopenmp-simd -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
|
|
// RUN: %clang_cc1 -fopenmp-simd -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY32 %s
|
|
// RUN: %clang_cc1 -DCK32 -verify -fopenmp-simd -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY32 %s
|
|
// RUN: %clang_cc1 -DCK32 -fopenmp-simd -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
|
|
// RUN: %clang_cc1 -fopenmp-simd -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY32 %s
|
|
// SIMD-ONLY32-NOT: {{__kmpc|__tgt}}
|
|
#ifdef CK32
|
|
|
|
// CK32-DAG: [[MTYPE_TO:@.+]] = {{.+}}constant [1 x i64] [i64 33]
|
|
// CK32-DAG: [[MTYPE_FROM:@.+]] = {{.+}}constant [1 x i64] [i64 34]
|
|
|
|
void array_shaping(float *f, int sa) {
|
|
|
|
// CK32-DAG: call i32 @__tgt_target_kernel(ptr @{{.+}}, i64 -1, i32 -1, i32 0, ptr @.{{.+}}.region_id, ptr [[ARGS:%.+]])
|
|
// CK32-DAG: [[BPARG:%.+]] = getelementptr inbounds {{.+}}[[ARGS]], i32 0, i32 2
|
|
// CK32-DAG: store ptr [[BPGEP:%.+]], ptr [[BPARG]]
|
|
// CK32-DAG: [[PARG:%.+]] = getelementptr inbounds {{.+}}[[ARGS]], i32 0, i32 3
|
|
// CK32-DAG: store ptr [[PGEP:%.+]], ptr [[PARG]]
|
|
// CK32-DAG: [[SARG:%.+]] = getelementptr inbounds {{.+}}[[ARGS]], i32 0, i32 4
|
|
// CK32-DAG: store ptr [[SIZES:%.+]], ptr [[SARG]]
|
|
// CK32-DAG: [[BPGEP]] = getelementptr inbounds {{.+}}[[BP:%[^,]+]]
|
|
// CK32-DAG: [[PGEP]] = getelementptr inbounds {{.+}}[[P:%[^,]+]]
|
|
// CK32-DAG: [[SIZES]] = getelementptr inbounds {{.+}}[[S:%[^,]+]]
|
|
|
|
// CK32-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0
|
|
// CK32-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0
|
|
// CK32-DAG: [[S0:%.+]] = getelementptr inbounds {{.+}}[[S]], i{{.+}} 0, i{{.+}} 0
|
|
|
|
|
|
// CK32-DAG: store ptr [[F1:%.+]], ptr [[BP0]],
|
|
// CK32-DAG: store ptr [[F2:%.+]], ptr [[P0]],
|
|
// CK32-DAG: store i64 [[SIZE:%.+]], ptr [[S0]],
|
|
|
|
// CK32-DAG: [[F1]] = load ptr, ptr [[F_ADDR:%.+]],
|
|
// CK32-DAG: [[F2]] = load ptr, ptr [[F_ADDR]],
|
|
// CK32-64-DAG: [[SIZE]] = mul nuw i64 [[SZ1:%.+]], 4
|
|
// CK32-64-DAG: [[SZ1]] = mul nuw i64 12, %{{.+}}
|
|
// CK32-32-DAG: [[SIZE]] = sext i32 [[SZ1:%.+]] to i64
|
|
// CK32-32-DAG: [[SZ1]] = mul nuw i32 [[SZ2:%.+]], 4
|
|
// CK32-32-DAG: [[SZ2]] = mul nuw i32 12, %{{.+}}
|
|
#pragma omp target map(to \
|
|
: ([3][sa][4])f)
|
|
f[0] = 1;
|
|
sa = 1;
|
|
// CK32-DAG: call i32 @__tgt_target_kernel(ptr @{{.+}}, i64 -1, i32 -1, i32 0, ptr @.{{.+}}.region_id, ptr [[ARGS:%.+]])
|
|
// CK32-DAG: [[BPARG:%.+]] = getelementptr inbounds {{.+}}[[ARGS]], i32 0, i32 2
|
|
// CK32-DAG: store ptr [[BPGEP:%.+]], ptr [[BPARG]]
|
|
// CK32-DAG: [[PARG:%.+]] = getelementptr inbounds {{.+}}[[ARGS]], i32 0, i32 3
|
|
// CK32-DAG: store ptr [[PGEP:%.+]], ptr [[PARG]]
|
|
// CK32-DAG: [[SARG:%.+]] = getelementptr inbounds {{.+}}[[ARGS]], i32 0, i32 4
|
|
// CK32-DAG: store ptr [[SIZES:%.+]], ptr [[SARG]]
|
|
// CK32-DAG: [[BPGEP]] = getelementptr inbounds {{.+}}[[BP:%[^,]+]]
|
|
// CK32-DAG: [[PGEP]] = getelementptr inbounds {{.+}}[[P:%[^,]+]]
|
|
// CK32-DAG: [[SIZES]] = getelementptr inbounds {{.+}}[[S:%[^,]+]]
|
|
|
|
// CK32-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0
|
|
// CK32-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0
|
|
// CK32-DAG: [[S0:%.+]] = getelementptr inbounds {{.+}}[[S]], i{{.+}} 0, i{{.+}} 0
|
|
|
|
|
|
// CK32-DAG: store ptr [[F1:%.+]], ptr [[BP0]],
|
|
// CK32-DAG: store ptr [[F2:%.+]], ptr [[P0]],
|
|
// CK32-DAG: store i64 [[SIZE:%.+]], ptr [[S0]],
|
|
|
|
// CK32-DAG: [[F1]] = load ptr, ptr [[F_ADDR:%.+]],
|
|
// CK32-DAG: [[F2]] = load ptr, ptr [[F_ADDR]],
|
|
// CK32-64-DAG: [[SIZE]] = mul nuw i64 [[SZ1:%.+]], 5
|
|
// CK32-64-DAG: [[SZ1]] = mul nuw i64 4, %{{.+}}
|
|
// CK32-32-DAG: [[SIZE]] = sext i32 [[SZ1:%.+]] to i64
|
|
// CK32-32-DAG: [[SZ1]] = mul nuw i32 [[SZ2:%.+]], 5
|
|
// CK32-32-DAG: [[SZ2]] = mul nuw i32 4, %{{.+}}
|
|
#pragma omp target map(from \
|
|
: ([sa][5])f)
|
|
f[0] = 1;
|
|
}
|
|
|
|
#endif // CK32
|
|
#endif
|