The OpenMP standard specifies the region inside to be a structured
block. This means that branches into or out of the region is not
permitted but branches are permitted inside the OpenMP single region.
This is currently modeled by having a region of kind `AnyRegion` for
all the OpenMP ops. In future we can have a more strictly defined
region.
Fixes #58396.
Reviewed By: peixin
Differential Revision: https://reviews.llvm.org/D137023
Variadic<AnyType>:$allocators_vars,
UnitAttr:$nowait);
- let regions = (region SizedRegion<1>:$region);
+ let regions = (region AnyRegion:$region);
let assemblyFormat = [{
oilist(`allocate` `(`
return
}
+// CHECK-LABEL: func @omp_single_multiple_blocks
+func.func @omp_single_multiple_blocks() {
+ // CHECK: omp.single {
+ omp.single {
+ cf.br ^bb2
+ ^bb2:
+ // CHECK: omp.terminator
+ omp.terminator
+ }
+ return
+}
+
// CHECK-LABEL: @omp_task
// CHECK-SAME: (%[[bool_var:.*]]: i1, %[[i64_var:.*]]: i64, %[[i32_var:.*]]: i32, %[[data_var:.*]]: memref<i32>)
func.func @omp_task(%bool_var: i1, %i64_var: i64, %i32_var: i32, %data_var: memref<i32>) {