Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
skatrak committed Aug 23, 2024
1 parent b996d13 commit fe401fb
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 45 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
! RUN: bbc -emit-fir -fopenmp -o - %s | FileCheck %s
! RUN: %flang_fc1 -emit-fir -fopenmp -o - %s | FileCheck %s
! XFAIL: *

! CHECK: omp.teams
! CHECK-SAME: reduction
Expand Down
4 changes: 2 additions & 2 deletions flang/test/Lower/OpenMP/sections-array-reduction.f90
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ subroutine sectionsReduction(x)
! CHECK: omp.parallel {
! CHECK: %[[VAL_3:.*]] = fir.alloca !fir.box<!fir.array<?xf32>>
! CHECK: fir.store %[[VAL_2]]#1 to %[[VAL_3]] : !fir.ref<!fir.box<!fir.array<?xf32>>>
! CHECK: omp.sections reduction(byref @add_reduction_byref_box_Uxf32 -> %[[VAL_3]] : !fir.ref<!fir.box<!fir.array<?xf32>>>) {
! CHECK: ^bb0(%[[VAL_4:.*]]: !fir.ref<!fir.box<!fir.array<?xf32>>>):
! CHECK: omp.sections reduction(byref @add_reduction_byref_box_Uxf32 %[[VAL_3]] -> %[[VAL_4:.*]] : !fir.ref<!fir.box<!fir.array<?xf32>>>) {
! CHECK: ^bb0(%[[VAL_4]]: !fir.ref<!fir.box<!fir.array<?xf32>>>):
! CHECK: omp.section {
! CHECK: ^bb0(%[[VAL_5:.*]]: !fir.ref<!fir.box<!fir.array<?xf32>>>):
! [...]
Expand Down
8 changes: 4 additions & 4 deletions flang/test/Lower/OpenMP/sections-reduction.f90
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ subroutine sectionsReduction(x,y)
! CHECK: %[[VAL_3:.*]]:2 = hlfir.declare %[[VAL_0]] dummy_scope %[[VAL_2]] {uniq_name = "_QFsectionsreductionEx"} : (!fir.ref<f32>, !fir.dscope) -> (!fir.ref<f32>, !fir.ref<f32>)
! CHECK: %[[VAL_4:.*]]:2 = hlfir.declare %[[VAL_1]] dummy_scope %[[VAL_2]] {uniq_name = "_QFsectionsreductionEy"} : (!fir.ref<f32>, !fir.dscope) -> (!fir.ref<f32>, !fir.ref<f32>)
! CHECK: omp.parallel {
! CHECK: omp.sections reduction(@add_reduction_f32 -> %[[VAL_3]]#0 : !fir.ref<f32>, @add_reduction_f32 -> %[[VAL_4]]#0 : !fir.ref<f32>) {
! CHECK: ^bb0(%[[VAL_5:.*]]: !fir.ref<f32>, %[[VAL_6:.*]]: !fir.ref<f32>):
! CHECK: omp.sections reduction(@add_reduction_f32 %[[VAL_3]]#0 -> %[[VAL_5:.*]] : !fir.ref<f32>, @add_reduction_f32 %[[VAL_4]]#0 -> %[[VAL_6:.*]] : !fir.ref<f32>) {
! CHECK: ^bb0(%[[VAL_5]]: !fir.ref<f32>, %[[VAL_6]]: !fir.ref<f32>):
! CHECK: omp.section {
! CHECK: ^bb0(%[[VAL_7:.*]]: !fir.ref<f32>, %[[VAL_8:.*]]: !fir.ref<f32>):
! CHECK: %[[VAL_9:.*]]:2 = hlfir.declare %[[VAL_7]] {uniq_name = "_QFsectionsreductionEx"} : (!fir.ref<f32>) -> (!fir.ref<f32>, !fir.ref<f32>)
Expand Down Expand Up @@ -71,8 +71,8 @@ subroutine sectionsReduction(x,y)
! CHECK: omp.terminator
! CHECK: }
! CHECK: omp.parallel {
! CHECK: omp.sections reduction(@add_reduction_f32 -> %[[VAL_3]]#0 : !fir.ref<f32>, @add_reduction_f32 -> %[[VAL_4]]#0 : !fir.ref<f32>) {
! CHECK: ^bb0(%[[VAL_23:.*]]: !fir.ref<f32>, %[[VAL_24:.*]]: !fir.ref<f32>):
! CHECK: omp.sections reduction(@add_reduction_f32 %[[VAL_3]]#0 -> %[[VAL_23:.*]] : !fir.ref<f32>, @add_reduction_f32 %[[VAL_4]]#0 -> %[[VAL_24:.*]] : !fir.ref<f32>) {
! CHECK: ^bb0(%[[VAL_23]]: !fir.ref<f32>, %[[VAL_24]]: !fir.ref<f32>):
! CHECK: omp.section {
! CHECK: ^bb0(%[[VAL_25:.*]]: !fir.ref<f32>, %[[VAL_26:.*]]: !fir.ref<f32>):
! CHECK: %[[VAL_27:.*]]:2 = hlfir.declare %[[VAL_25]] {uniq_name = "_QFsectionsreductionEx"} : (!fir.ref<f32>) -> (!fir.ref<f32>, !fir.ref<f32>)
Expand Down
16 changes: 11 additions & 5 deletions mlir/test/Dialect/OpenMP/invalid.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -1560,7 +1560,8 @@ func.func @omp_task_depend(%data_var: memref<i32>) {

func.func @omp_task(%ptr: !llvm.ptr) {
// expected-error @below {{op expected symbol reference @add_f32 to point to a reduction declaration}}
omp.task in_reduction(@add_f32 -> %ptr : !llvm.ptr) {
omp.task in_reduction(@add_f32 %ptr -> %arg0 : !llvm.ptr) {
^bb0(%arg0: !llvm.ptr):
// CHECK: "test.foo"() : () -> ()
"test.foo"() : () -> ()
// CHECK: omp.terminator
Expand All @@ -1584,7 +1585,8 @@ combiner {

func.func @omp_task(%ptr: !llvm.ptr) {
// expected-error @below {{op accumulator variable used more than once}}
omp.task in_reduction(@add_f32 -> %ptr : !llvm.ptr, @add_f32 -> %ptr : !llvm.ptr) {
omp.task in_reduction(@add_f32 %ptr -> %arg0 : !llvm.ptr, @add_f32 %ptr -> %arg1 : !llvm.ptr) {
^bb0(%arg0: !llvm.ptr, %arg1: !llvm.ptr):
// CHECK: "test.foo"() : () -> ()
"test.foo"() : () -> ()
// CHECK: omp.terminator
Expand Down Expand Up @@ -1614,7 +1616,8 @@ atomic {

func.func @omp_task(%mem: memref<1xf32>) {
// expected-error @below {{op expected accumulator ('memref<1xf32>') to be the same type as reduction declaration ('!llvm.ptr')}}
omp.task in_reduction(@add_i32 -> %mem : memref<1xf32>) {
omp.task in_reduction(@add_i32 %mem -> %arg0 : memref<1xf32>) {
^bb0(%arg0: memref<1xf32>):
// CHECK: "test.foo"() : () -> ()
"test.foo"() : () -> ()
// CHECK: omp.terminator
Expand Down Expand Up @@ -1800,6 +1803,7 @@ func.func @taskloop(%lb: i32, %ub: i32, %step: i32) {
%testf32 = "test.f32"() : () -> (!llvm.ptr)
// expected-error @below {{expected as many reduction symbol references as reduction variables}}
"omp.taskloop"(%testf32) ({
^bb0(%arg0: !llvm.ptr):
omp.loop_nest (%i, %j) : i32 = (%lb, %ub) to (%ub, %lb) step (%step, %step) {
omp.yield
}
Expand All @@ -1825,7 +1829,8 @@ func.func @taskloop(%lb: i32, %ub: i32, %step: i32) {
%testf32 = "test.f32"() : () -> (!llvm.ptr)
%testf32_2 = "test.f32"() : () -> (!llvm.ptr)
// expected-error @below {{if a reduction clause is present on the taskloop directive, the nogroup clause must not be specified}}
omp.taskloop reduction(@add_f32 -> %testf32 : !llvm.ptr, @add_f32 -> %testf32_2 : !llvm.ptr) nogroup {
omp.taskloop reduction(@add_f32 %testf32 -> %arg0 : !llvm.ptr, @add_f32 %testf32_2 -> %arg1 : !llvm.ptr) nogroup {
^bb0(%arg0: !llvm.ptr, %arg1: !llvm.ptr):
omp.loop_nest (%i, %j) : i32 = (%lb, %ub) to (%ub, %lb) step (%step, %step) {
omp.yield
}
Expand All @@ -1850,7 +1855,8 @@ combiner {
func.func @taskloop(%lb: i32, %ub: i32, %step: i32) {
%testf32 = "test.f32"() : () -> (!llvm.ptr)
// expected-error @below {{the same list item cannot appear in both a reduction and an in_reduction clause}}
omp.taskloop reduction(@add_f32 -> %testf32 : !llvm.ptr) in_reduction(@add_f32 -> %testf32 : !llvm.ptr) {
omp.taskloop reduction(@add_f32 %testf32 -> %arg0 : !llvm.ptr) in_reduction(@add_f32 %testf32 -> %arg1 : !llvm.ptr) {
^bb0(%arg0: !llvm.ptr, %arg1: !llvm.ptr):
omp.loop_nest (%i, %j) : i32 = (%lb, %ub) to (%ub, %lb) step (%step, %step) {
omp.yield
}
Expand Down
78 changes: 47 additions & 31 deletions mlir/test/Dialect/OpenMP/ops.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -1094,16 +1094,18 @@ func.func @omp_teams(%lb : i32, %ub : i32, %if_cond : i1, %num_threads : i32,
// Test reduction.
%c1 = arith.constant 1 : i32
%0 = llvm.alloca %c1 x i32 : (i32) -> !llvm.ptr
// CHECK: omp.teams reduction(@add_f32 -> %{{.+}} : !llvm.ptr) {
omp.teams reduction(@add_f32 -> %0 : !llvm.ptr) {
// CHECK: omp.teams reduction(@add_f32 %{{.+}} -> %{{.+}} : !llvm.ptr) {
omp.teams reduction(@add_f32 %0 -> %arg0 : !llvm.ptr) {
^bb0(%arg0: !llvm.ptr):
%1 = arith.constant 2.0 : f32
// CHECK: omp.terminator
omp.terminator
}

// Test reduction byref
// CHECK: omp.teams reduction(byref @add_f32 -> %{{.+}} : !llvm.ptr) {
omp.teams reduction(byref @add_f32 -> %0 : !llvm.ptr) {
// CHECK: omp.teams reduction(byref @add_f32 %{{.+}} -> %{{.+}} : !llvm.ptr) {
omp.teams reduction(byref @add_f32 %0 -> %arg0 : !llvm.ptr) {
^bb0(%arg0: !llvm.ptr):
%1 = arith.constant 2.0 : f32
// CHECK: omp.terminator
omp.terminator
Expand All @@ -1123,8 +1125,9 @@ func.func @omp_teams(%lb : i32, %ub : i32, %if_cond : i1, %num_threads : i32,
func.func @sections_reduction() {
%c1 = arith.constant 1 : i32
%0 = llvm.alloca %c1 x i32 : (i32) -> !llvm.ptr
// CHECK: omp.sections reduction(@add_f32 -> {{.+}} : !llvm.ptr)
omp.sections reduction(@add_f32 -> %0 : !llvm.ptr) {
// CHECK: omp.sections reduction(@add_f32 {{.+}} -> {{.+}} : !llvm.ptr)
omp.sections reduction(@add_f32 %0 -> %arg0 : !llvm.ptr) {
^bb0(%arg0: !llvm.ptr):
// CHECK: omp.section
omp.section {
%1 = arith.constant 2.0 : f32
Expand All @@ -1144,8 +1147,9 @@ func.func @sections_reduction() {
func.func @sections_reduction_byref() {
%c1 = arith.constant 1 : i32
%0 = llvm.alloca %c1 x i32 : (i32) -> !llvm.ptr
// CHECK: omp.sections reduction(byref @add_f32 -> {{.+}} : !llvm.ptr)
omp.sections reduction(byref @add_f32 -> %0 : !llvm.ptr) {
// CHECK: omp.sections reduction(byref @add_f32 {{.+}} -> {{.+}} : !llvm.ptr)
omp.sections reduction(byref @add_f32 %0 -> %arg0 : !llvm.ptr) {
^bb0(%arg0: !llvm.ptr):
// CHECK: omp.section
omp.section {
%1 = arith.constant 2.0 : f32
Expand Down Expand Up @@ -1243,8 +1247,9 @@ func.func @parallel_wsloop_reduction2(%lb : index, %ub : index, %step : index) {
// CHECK-LABEL: func @sections_reduction2
func.func @sections_reduction2() {
%0 = memref.alloca() : memref<1xf32>
// CHECK: omp.sections reduction(@add2_f32 -> %{{.+}} : memref<1xf32>)
omp.sections reduction(@add2_f32 -> %0 : memref<1xf32>) {
// CHECK: omp.sections reduction(@add2_f32 %{{.+}} -> %{{.+}} : memref<1xf32>)
omp.sections reduction(@add2_f32 %0 -> %arg0 : memref<1xf32>) {
^bb0(%arg0: memref<1xf32>):
omp.section {
%1 = arith.constant 2.0 : f32
omp.terminator
Expand Down Expand Up @@ -1899,8 +1904,9 @@ func.func @omp_sectionsop(%data_var1 : memref<i32>, %data_var2 : memref<i32>,
omp.terminator
}) {operandSegmentSizes = array<i32: 1,1,0,0>} : (memref<i32>, memref<i32>) -> ()

// CHECK: omp.sections reduction(@add_f32 -> %{{.*}} : !llvm.ptr)
// CHECK: omp.sections reduction(@add_f32 %{{.*}} -> %{{.*}} : !llvm.ptr)
"omp.sections" (%redn_var) ({
^bb0(%arg0: !llvm.ptr):
// CHECK: omp.terminator
omp.terminator
}) {operandSegmentSizes = array<i32: 0,0,0,1>, reduction_byref = array<i1: false>, reduction_syms=[@add_f32]} : (!llvm.ptr) -> ()
Expand All @@ -1911,8 +1917,9 @@ func.func @omp_sectionsop(%data_var1 : memref<i32>, %data_var2 : memref<i32>,
omp.terminator
}

// CHECK: omp.sections reduction(@add_f32 -> %{{.*}} : !llvm.ptr) {
omp.sections reduction(@add_f32 -> %redn_var : !llvm.ptr) {
// CHECK: omp.sections reduction(@add_f32 %{{.*}} -> %{{.*}} : !llvm.ptr) {
omp.sections reduction(@add_f32 %redn_var -> %arg0 : !llvm.ptr) {
^bb0(%arg0: !llvm.ptr):
// CHECK: omp.terminator
omp.terminator
}
Expand Down Expand Up @@ -2085,17 +2092,19 @@ func.func @omp_task(%bool_var: i1, %i64_var: i64, %i32_var: i32, %data_var: memr
%0 = llvm.alloca %c1 x f32 : (i32) -> !llvm.ptr
// CHECK: %[[redn_var2:.*]] = llvm.alloca %{{.*}} x f32 : (i32) -> !llvm.ptr
%1 = llvm.alloca %c1 x f32 : (i32) -> !llvm.ptr
// CHECK: omp.task in_reduction(@add_f32 -> %[[redn_var1]] : !llvm.ptr, @add_f32 -> %[[redn_var2]] : !llvm.ptr) {
omp.task in_reduction(@add_f32 -> %0 : !llvm.ptr, @add_f32 -> %1 : !llvm.ptr) {
// CHECK: omp.task in_reduction(@add_f32 %[[redn_var1]] -> %{{.+}} : !llvm.ptr, @add_f32 %[[redn_var2]] -> %{{.+}} : !llvm.ptr) {
omp.task in_reduction(@add_f32 %0 -> %arg0 : !llvm.ptr, @add_f32 %1 -> %arg1 : !llvm.ptr) {
^bb0(%arg0: !llvm.ptr, %arg1: !llvm.ptr):
// CHECK: "test.foo"() : () -> ()
"test.foo"() : () -> ()
// CHECK: omp.terminator
omp.terminator
}

// Checking `in_reduction` clause (mixed) byref
// CHECK: omp.task in_reduction(byref @add_f32 -> %[[redn_var1]] : !llvm.ptr, @add_f32 -> %[[redn_var2]] : !llvm.ptr) {
omp.task in_reduction(byref @add_f32 -> %0 : !llvm.ptr, @add_f32 -> %1 : !llvm.ptr) {
// CHECK: omp.task in_reduction(byref @add_f32 %[[redn_var1]] -> %{{.+}} : !llvm.ptr, @add_f32 %[[redn_var2]] -> %{{.+}} : !llvm.ptr) {
omp.task in_reduction(byref @add_f32 %0 -> %arg0 : !llvm.ptr, @add_f32 %1 -> %arg1 : !llvm.ptr) {
^bb0(%arg0: !llvm.ptr, %arg1: !llvm.ptr):
// CHECK: "test.foo"() : () -> ()
"test.foo"() : () -> ()
// CHECK: omp.terminator
Expand Down Expand Up @@ -2125,10 +2134,11 @@ func.func @omp_task(%bool_var: i1, %i64_var: i64, %i32_var: i32, %data_var: memr
omp.task allocate(%data_var : memref<i32> -> %data_var : memref<i32>)
// CHECK-SAME: final(%[[bool_var]]) if(%[[bool_var]])
final(%bool_var) if(%bool_var)
// CHECK-SAME: in_reduction(@add_f32 -> %[[redn_var1]] : !llvm.ptr, byref @add_f32 -> %[[redn_var2]] : !llvm.ptr)
in_reduction(@add_f32 -> %0 : !llvm.ptr, byref @add_f32 -> %1 : !llvm.ptr)
// CHECK-SAME: in_reduction(@add_f32 %[[redn_var1]] -> %{{.+}} : !llvm.ptr, byref @add_f32 %[[redn_var2]] -> %{{.+}} : !llvm.ptr)
in_reduction(@add_f32 %0 -> %arg0 : !llvm.ptr, byref @add_f32 %1 -> %arg1 : !llvm.ptr)
// CHECK-SAME: priority(%[[i32_var]] : i32) untied
priority(%i32_var : i32) untied {
^bb0(%arg0: !llvm.ptr, %arg1: !llvm.ptr):
// CHECK: "test.foo"() : () -> ()
"test.foo"() : () -> ()
// CHECK: omp.terminator
Expand Down Expand Up @@ -2304,8 +2314,9 @@ func.func @omp_taskgroup_multiple_tasks() -> () {
func.func @omp_taskgroup_clauses() -> () {
%testmemref = "test.memref"() : () -> (memref<i32>)
%testf32 = "test.f32"() : () -> (!llvm.ptr)
// CHECK: omp.taskgroup allocate(%{{.+}}: memref<i32> -> %{{.+}}: memref<i32>) task_reduction(@add_f32 -> %{{.+}}: !llvm.ptr)
omp.taskgroup allocate(%testmemref : memref<i32> -> %testmemref : memref<i32>) task_reduction(@add_f32 -> %testf32 : !llvm.ptr) {
// CHECK: omp.taskgroup allocate(%{{.+}}: memref<i32> -> %{{.+}}: memref<i32>) task_reduction(@add_f32 %{{.+}} -> %{{.+}}: !llvm.ptr)
omp.taskgroup allocate(%testmemref : memref<i32> -> %testmemref : memref<i32>) task_reduction(@add_f32 %testf32 -> %arg0 : !llvm.ptr) {
^bb0(%arg0: !llvm.ptr):
// CHECK: omp.task
omp.task {
"test.foo"() : () -> ()
Expand Down Expand Up @@ -2376,8 +2387,9 @@ func.func @omp_taskloop(%lb: i32, %ub: i32, %step: i32) -> () {

%testf32 = "test.f32"() : () -> (!llvm.ptr)
%testf32_2 = "test.f32"() : () -> (!llvm.ptr)
// CHECK: omp.taskloop in_reduction(@add_f32 -> %{{.+}} : !llvm.ptr, @add_f32 -> %{{.+}} : !llvm.ptr) {
omp.taskloop in_reduction(@add_f32 -> %testf32 : !llvm.ptr, @add_f32 -> %testf32_2 : !llvm.ptr) {
// CHECK: omp.taskloop in_reduction(@add_f32 %{{.+}} -> %{{.+}} : !llvm.ptr, @add_f32 %{{.+}} -> %{{.+}} : !llvm.ptr) {
omp.taskloop in_reduction(@add_f32 %testf32 -> %arg0 : !llvm.ptr, @add_f32 %testf32_2 -> %arg1 : !llvm.ptr) {
^bb0(%arg0: !llvm.ptr, %arg1: !llvm.ptr):
omp.loop_nest (%i, %j) : i32 = (%lb, %ub) to (%ub, %lb) step (%step, %step) {
// CHECK: omp.yield
omp.yield
Expand All @@ -2386,17 +2398,19 @@ func.func @omp_taskloop(%lb: i32, %ub: i32, %step: i32) -> () {
}

// Checking byref attribute for in_reduction
// CHECK: omp.taskloop in_reduction(byref @add_f32 -> %{{.+}} : !llvm.ptr, @add_f32 -> %{{.+}} : !llvm.ptr) {
omp.taskloop in_reduction(byref @add_f32 -> %testf32 : !llvm.ptr, @add_f32 -> %testf32_2 : !llvm.ptr) {
// CHECK: omp.taskloop in_reduction(byref @add_f32 %{{.+}} -> %{{.+}} : !llvm.ptr, @add_f32 %{{.+}} -> %{{.+}} : !llvm.ptr) {
omp.taskloop in_reduction(byref @add_f32 %testf32 -> %arg0 : !llvm.ptr, @add_f32 %testf32_2 -> %arg1 : !llvm.ptr) {
^bb0(%arg0: !llvm.ptr, %arg1: !llvm.ptr):
omp.loop_nest (%i, %j) : i32 = (%lb, %ub) to (%ub, %lb) step (%step, %step) {
// CHECK: omp.yield
omp.yield
}
omp.terminator
}

// CHECK: omp.taskloop reduction(byref @add_f32 -> %{{.+}} : !llvm.ptr, @add_f32 -> %{{.+}} : !llvm.ptr) {
omp.taskloop reduction(byref @add_f32 -> %testf32 : !llvm.ptr, @add_f32 -> %testf32_2 : !llvm.ptr) {
// CHECK: omp.taskloop reduction(byref @add_f32 %{{.+}} -> %{{.+}} : !llvm.ptr, @add_f32 %{{.+}} -> %{{.+}} : !llvm.ptr) {
omp.taskloop reduction(byref @add_f32 %testf32 -> %arg0 : !llvm.ptr, @add_f32 %testf32_2 -> %arg1 : !llvm.ptr) {
^bb0(%arg0: !llvm.ptr, %arg1: !llvm.ptr):
omp.loop_nest (%i, %j) : i32 = (%lb, %ub) to (%ub, %lb) step (%step, %step) {
// CHECK: omp.yield
omp.yield
Expand All @@ -2405,17 +2419,19 @@ func.func @omp_taskloop(%lb: i32, %ub: i32, %step: i32) -> () {
}

// check byref attrbute for reduction
// CHECK: omp.taskloop reduction(byref @add_f32 -> %{{.+}} : !llvm.ptr, byref @add_f32 -> %{{.+}} : !llvm.ptr) {
omp.taskloop reduction(byref @add_f32 -> %testf32 : !llvm.ptr, byref @add_f32 -> %testf32_2 : !llvm.ptr) {
// CHECK: omp.taskloop reduction(byref @add_f32 %{{.+}} -> %{{.+}} : !llvm.ptr, byref @add_f32 %{{.+}} -> %{{.+}} : !llvm.ptr) {
omp.taskloop reduction(byref @add_f32 %testf32 -> %arg0 : !llvm.ptr, byref @add_f32 %testf32_2 -> %arg1 : !llvm.ptr) {
^bb0(%arg0: !llvm.ptr, %arg1: !llvm.ptr):
omp.loop_nest (%i, %j) : i32 = (%lb, %ub) to (%ub, %lb) step (%step, %step) {
// CHECK: omp.yield
omp.yield
}
omp.terminator
}

// CHECK: omp.taskloop in_reduction(@add_f32 -> %{{.+}} : !llvm.ptr) reduction(@add_f32 -> %{{.+}} : !llvm.ptr) {
omp.taskloop in_reduction(@add_f32 -> %testf32 : !llvm.ptr) reduction(@add_f32 -> %testf32_2 : !llvm.ptr) {
// CHECK: omp.taskloop in_reduction(@add_f32 %{{.+}} -> %{{.+}} : !llvm.ptr) reduction(@add_f32 %{{.+}} -> %{{.+}} : !llvm.ptr) {
omp.taskloop in_reduction(@add_f32 %testf32 -> %arg0 : !llvm.ptr) reduction(@add_f32 %testf32_2 -> %arg1 : !llvm.ptr) {
^bb0(%arg0: !llvm.ptr, %arg1: !llvm.ptr):
omp.loop_nest (%i, %j) : i32 = (%lb, %ub) to (%ub, %lb) step (%step, %step) {
// CHECK: omp.yield
omp.yield
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ llvm.func @sectionsreduction_(%arg0: !llvm.ptr {fir.bindc_name = "x"}) attribute
%2 = llvm.mlir.constant(1 : index) : i64
omp.parallel {
%3 = llvm.alloca %0 x !llvm.struct<(ptr, i64, i32, i8, i8, i8, i8, array<1 x array<3 x i64>>)> : (i64) -> !llvm.ptr
omp.sections reduction(byref @add_reduction_byref_box_Uxf32 -> %3 : !llvm.ptr) {
omp.sections reduction(byref @add_reduction_byref_box_Uxf32 %3 -> %arg1 : !llvm.ptr) {
^bb0(%arg1: !llvm.ptr):
omp.section {
^bb0(%arg2: !llvm.ptr):
Expand Down
2 changes: 1 addition & 1 deletion mlir/test/Target/LLVMIR/openmp-reduction-sections.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ llvm.func @sections_(%arg0: !llvm.ptr {fir.bindc_name = "x"}) attributes {fir.in
%0 = llvm.mlir.constant(2.000000e+00 : f32) : f32
%1 = llvm.mlir.constant(1.000000e+00 : f32) : f32
omp.parallel {
omp.sections reduction(@add_reduction_f32 -> %arg0 : !llvm.ptr) {
omp.sections reduction(@add_reduction_f32 %arg0 -> %arg1 : !llvm.ptr) {
^bb0(%arg1: !llvm.ptr):
omp.section {
^bb0(%arg2: !llvm.ptr):
Expand Down

0 comments on commit fe401fb

Please sign in to comment.