312 changes: 156 additions & 156 deletions clang/test/OpenMP/sections_firstprivate_codegen.cpp

Large diffs are not rendered by default.

586 changes: 300 additions & 286 deletions clang/test/OpenMP/single_codegen.cpp

Large diffs are not rendered by default.

312 changes: 156 additions & 156 deletions clang/test/OpenMP/single_firstprivate_codegen.cpp

Large diffs are not rendered by default.

536 changes: 268 additions & 268 deletions clang/test/OpenMP/task_codegen.cpp

Large diffs are not rendered by default.

308 changes: 270 additions & 38 deletions clang/test/OpenMP/taskgroup_codegen.cpp

Large diffs are not rendered by default.

7,050 changes: 7,000 additions & 50 deletions clang/test/OpenMP/threadprivate_codegen.cpp

Large diffs are not rendered by default.

36 changes: 18 additions & 18 deletions clang/test/OpenMP/tile_codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1078,21 +1078,15 @@ extern "C" void tfoo7() {
// CHECK1-NEXT: ret void
//
//
// CHECK2-LABEL: define {{[^@]+}}@body
// CHECK2-SAME: (...) #[[ATTR0:[0-9]+]] {
// CHECK2-NEXT: entry:
// CHECK2-NEXT: ret void
//
//
// CHECK2-LABEL: define {{[^@]+}}@__cxx_global_var_init
// CHECK2-SAME: () #[[ATTR1:[0-9]+]] section ".text.startup" {
// CHECK2-SAME: () #[[ATTR0:[0-9]+]] section ".text.startup" {
// CHECK2-NEXT: entry:
// CHECK2-NEXT: call void @_ZN1SC1Ev(%struct.S* nonnull dereferenceable(4) @s)
// CHECK2-NEXT: ret void
//
//
// CHECK2-LABEL: define {{[^@]+}}@_ZN1SC1Ev
// CHECK2-SAME: (%struct.S* nonnull dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR2:[0-9]+]] comdat align 2 {
// CHECK2-SAME: (%struct.S* nonnull dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1:[0-9]+]] comdat align 2 {
// CHECK2-NEXT: entry:
// CHECK2-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S*, align 8
// CHECK2-NEXT: store %struct.S* [[THIS]], %struct.S** [[THIS_ADDR]], align 8
Expand All @@ -1102,7 +1096,7 @@ extern "C" void tfoo7() {
//
//
// CHECK2-LABEL: define {{[^@]+}}@_ZN1SC2Ev
// CHECK2-SAME: (%struct.S* nonnull dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR2]] comdat align 2 {
// CHECK2-SAME: (%struct.S* nonnull dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
// CHECK2-NEXT: entry:
// CHECK2-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S*, align 8
// CHECK2-NEXT: [[I:%.*]] = alloca i32*, align 8
Expand Down Expand Up @@ -1164,8 +1158,14 @@ extern "C" void tfoo7() {
// CHECK2-NEXT: ret void
//
//
// CHECK2-LABEL: define {{[^@]+}}@body
// CHECK2-SAME: (...) #[[ATTR2:[0-9]+]] {
// CHECK2-NEXT: entry:
// CHECK2-NEXT: ret void
//
//
// CHECK2-LABEL: define {{[^@]+}}@foo1
// CHECK2-SAME: (i32 [[START:%.*]], i32 [[END:%.*]], i32 [[STEP:%.*]]) #[[ATTR0]] {
// CHECK2-SAME: (i32 [[START:%.*]], i32 [[END:%.*]], i32 [[STEP:%.*]]) #[[ATTR2]] {
// CHECK2-NEXT: entry:
// CHECK2-NEXT: [[START_ADDR:%.*]] = alloca i32, align 4
// CHECK2-NEXT: [[END_ADDR:%.*]] = alloca i32, align 4
Expand Down Expand Up @@ -1255,7 +1255,7 @@ extern "C" void tfoo7() {
//
//
// CHECK2-LABEL: define {{[^@]+}}@foo2
// CHECK2-SAME: (i32 [[START:%.*]], i32 [[END:%.*]], i32 [[STEP:%.*]]) #[[ATTR0]] {
// CHECK2-SAME: (i32 [[START:%.*]], i32 [[END:%.*]], i32 [[STEP:%.*]]) #[[ATTR2]] {
// CHECK2-NEXT: entry:
// CHECK2-NEXT: [[START_ADDR:%.*]] = alloca i32, align 4
// CHECK2-NEXT: [[END_ADDR:%.*]] = alloca i32, align 4
Expand Down Expand Up @@ -1368,7 +1368,7 @@ extern "C" void tfoo7() {
//
//
// CHECK2-LABEL: define {{[^@]+}}@foo3
// CHECK2-SAME: () #[[ATTR0]] {
// CHECK2-SAME: () #[[ATTR2]] {
// CHECK2-NEXT: entry:
// CHECK2-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
// CHECK2-NEXT: [[TMP:%.*]] = alloca i32, align 4
Expand Down Expand Up @@ -1510,7 +1510,7 @@ extern "C" void tfoo7() {
//
//
// CHECK2-LABEL: define {{[^@]+}}@foo4
// CHECK2-SAME: () #[[ATTR0]] {
// CHECK2-SAME: () #[[ATTR2]] {
// CHECK2-NEXT: entry:
// CHECK2-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
// CHECK2-NEXT: [[TMP:%.*]] = alloca i32, align 4
Expand Down Expand Up @@ -1663,7 +1663,7 @@ extern "C" void tfoo7() {
//
//
// CHECK2-LABEL: define {{[^@]+}}@foo5
// CHECK2-SAME: () #[[ATTR0]] {
// CHECK2-SAME: () #[[ATTR2]] {
// CHECK2-NEXT: entry:
// CHECK2-NEXT: [[DOTOMP_IV:%.*]] = alloca i64, align 8
// CHECK2-NEXT: [[TMP:%.*]] = alloca i32, align 4
Expand Down Expand Up @@ -1872,7 +1872,7 @@ extern "C" void tfoo7() {
//
//
// CHECK2-LABEL: define {{[^@]+}}@foo6
// CHECK2-SAME: () #[[ATTR0]] {
// CHECK2-SAME: () #[[ATTR2]] {
// CHECK2-NEXT: entry:
// CHECK2-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB2]], i32 0, void (i32*, i32*, ...)* bitcast (void (i32*, i32*)* @.omp_outlined. to void (i32*, i32*, ...)*))
// CHECK2-NEXT: ret void
Expand Down Expand Up @@ -1975,14 +1975,14 @@ extern "C" void tfoo7() {
//
//
// CHECK2-LABEL: define {{[^@]+}}@tfoo7
// CHECK2-SAME: () #[[ATTR0]] {
// CHECK2-SAME: () #[[ATTR2]] {
// CHECK2-NEXT: entry:
// CHECK2-NEXT: call void @_Z4foo7IiLi3ELi5EEvT_S0_(i32 0, i32 42)
// CHECK2-NEXT: ret void
//
//
// CHECK2-LABEL: define {{[^@]+}}@_Z4foo7IiLi3ELi5EEvT_S0_
// CHECK2-SAME: (i32 [[START:%.*]], i32 [[END:%.*]]) #[[ATTR0]] comdat {
// CHECK2-SAME: (i32 [[START:%.*]], i32 [[END:%.*]]) #[[ATTR2]] comdat {
// CHECK2-NEXT: entry:
// CHECK2-NEXT: [[START_ADDR:%.*]] = alloca i32, align 4
// CHECK2-NEXT: [[END_ADDR:%.*]] = alloca i32, align 4
Expand Down Expand Up @@ -2066,7 +2066,7 @@ extern "C" void tfoo7() {
//
//
// CHECK2-LABEL: define {{[^@]+}}@_GLOBAL__sub_I_tile_codegen.cpp
// CHECK2-SAME: () #[[ATTR1]] section ".text.startup" {
// CHECK2-SAME: () #[[ATTR0]] section ".text.startup" {
// CHECK2-NEXT: entry:
// CHECK2-NEXT: call void @__cxx_global_var_init()
// CHECK2-NEXT: ret void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,15 @@ void foo(void) {
A[i] = 1.0;
}
}
// OMP-LABEL: @foo(
// OMP-LABEL: @main(
// OMP-NEXT: entry:
// OMP-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
// OMP-NEXT: [[I:%.*]] = alloca i32, align 4
// OMP-NEXT: store i32 0, i32* [[RETVAL]], align 4
// OMP-NEXT: store i32 0, i32* [[I]], align 4
// OMP-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB2:[0-9]+]], i32 0, void (i32*, i32*, ...)* bitcast (void (i32*, i32*)* @.omp_outlined. to void (i32*, i32*, ...)*))
// OMP-NEXT: ret void
// OMP-NEXT: call void @foo()
// OMP-NEXT: ret i32 0
//
//
// OMP-LABEL: @.omp_outlined.(
Expand Down Expand Up @@ -85,7 +88,7 @@ void foo(void) {
// OMP-NEXT: [[TMP8:%.*]] = load i32, i32* [[I]], align 4
// OMP-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP8]] to i64
// OMP-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [33554432 x double], [33554432 x double]* @A, i64 0, i64 [[IDXPROM]]
// OMP-NEXT: store double 1.000000e+00, double* [[ARRAYIDX]], align 8
// OMP-NEXT: store double 0.000000e+00, double* [[ARRAYIDX]], align 8
// OMP-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
// OMP: omp.body.continue:
// OMP-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
Expand All @@ -101,15 +104,12 @@ void foo(void) {
// OMP-NEXT: ret void
//
//
// OMP-LABEL: @main(
// OMP-LABEL: @foo(
// OMP-NEXT: entry:
// OMP-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
// OMP-NEXT: [[I:%.*]] = alloca i32, align 4
// OMP-NEXT: store i32 0, i32* [[RETVAL]], align 4
// OMP-NEXT: store i32 0, i32* [[I]], align 4
// OMP-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB2]], i32 0, void (i32*, i32*, ...)* bitcast (void (i32*, i32*)* @.omp_outlined..1 to void (i32*, i32*, ...)*))
// OMP-NEXT: call void @foo()
// OMP-NEXT: ret i32 0
// OMP-NEXT: ret void
//
//
// OMP-LABEL: @.omp_outlined..1(
Expand Down Expand Up @@ -159,7 +159,7 @@ void foo(void) {
// OMP-NEXT: [[TMP8:%.*]] = load i32, i32* [[I]], align 4
// OMP-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP8]] to i64
// OMP-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [33554432 x double], [33554432 x double]* @A, i64 0, i64 [[IDXPROM]]
// OMP-NEXT: store double 0.000000e+00, double* [[ARRAYIDX]], align 8
// OMP-NEXT: store double 1.000000e+00, double* [[ARRAYIDX]], align 8
// OMP-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
// OMP: omp.body.continue:
// OMP-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ void foo(void);
// OMP-NEXT: [[I:%.*]] = alloca i32, align 4
// OMP-NEXT: store i32 0, i32* [[RETVAL]], align 4
// OMP-NEXT: store i32 0, i32* [[I]], align 4
// OMP-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB2:[0-9]+]], i32 0, void (i32*, i32*, ...)* bitcast (void (i32*, i32*)* @.omp_outlined..1 to void (i32*, i32*, ...)*))
// OMP-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB2:[0-9]+]], i32 0, void (i32*, i32*, ...)* bitcast (void (i32*, i32*)* @.omp_outlined. to void (i32*, i32*, ...)*))
// OMP-NEXT: call void @foo()
// OMP-NEXT: ret i32 0
//
Expand Down Expand Up @@ -63,7 +63,7 @@ int main() {
// OMP-NEXT: entry:
// OMP-NEXT: [[I:%.*]] = alloca i32, align 4
// OMP-NEXT: store i32 0, i32* [[I]], align 4
// OMP-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB2]], i32 0, void (i32*, i32*, ...)* bitcast (void (i32*, i32*)* @.omp_outlined. to void (i32*, i32*, ...)*))
// OMP-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB2]], i32 0, void (i32*, i32*, ...)* bitcast (void (i32*, i32*)* @.omp_outlined..1 to void (i32*, i32*, ...)*))
// OMP-NEXT: ret void
//
// NOOMP-LABEL: @foo(
Expand Down
7 changes: 7 additions & 0 deletions llvm/include/llvm/Frontend/OpenMP/OMP.td
Original file line number Diff line number Diff line change
Expand Up @@ -922,6 +922,13 @@ def OMP_Distribute : Directive<"distribute"> {
VersionedClause<OMPC_DistSchedule>
];
}
def OMP_BeginDeclareTarget : Directive<"begin declare target"> {
let allowedClauses = [
VersionedClause<OMPC_To>,
VersionedClause<OMPC_Link>,
VersionedClause<OMPC_DeviceType>,
];
}
def OMP_DeclareTarget : Directive<"declare target"> {
let allowedClauses = [
VersionedClause<OMPC_To>,
Expand Down