Skip to content

[Flang] Compilation failure in 621.wrf_s (Allow branches inside an OpenMP single region) #58396

@kiranchandramohan

Description

@kiranchandramohan

The OpenMP single construct can contain a structured block. A structured block allows branches inside. Hence the correct modelling for this is AnyRegion and not SizedRegion<1>.

So code like the following which will create multiple blocks is allowed. Currently a verification failure happens while converting to LLVM, since the LLVM dialect representation will contain multiple blocks for this.

subroutine fun_real(c)
real::psum
logical:: c
!$OMP SINGLE
    if(c) then
       call myfunc(psum)
    end if
!$OMP END SINGLE
end subroutine

Current Error

error: loc("./tmp2.f90":1:1): 'omp.single' op region #0 ('region') failed to verify constraint: region with 1 blocks
error: Lowering to LLVM IR failed
error: loc("./tmp2.f90":1:1): cannot be converted to LLVM IR: missing `LLVMTranslationDialectInterface` registration for dialect for op: func.func

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issuehttps://github.com/llvm/llvm-project/contributemliropenmp

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions