Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flang-new unhandled reduction container, UNREACHABLE executed #80739

Closed
keidavis opened this issue Feb 5, 2024 · 3 comments
Closed

flang-new unhandled reduction container, UNREACHABLE executed #80739

keidavis opened this issue Feb 5, 2024 · 3 comments

Comments

@keidavis
Copy link

keidavis commented Feb 5, 2024

Reproducer below. LLVM project source updated Feb 5 2024.

flang-new -fopenmp -c

Interestingly, the crash goes away if !$OMP SIMD is removed.

MODULE kernel_module

CONTAINS

  SUBROUTINE kernel

    IMPLICIT NONE

    INTEGER :: xl, xh, yl, yh
    REAL    :: r

    INTEGER :: j, k
    REAL    :: c

    xl = 0 ; xh = 1 ; yl = 0 ; yh = 1
    r = 0.0 ; c = 0.0

    !$OMP PARALLEL                                                                                             
    !$OMP DO PRIVATE(c) REDUCTION(+ : r)                                                                       
    DO k = yl, yh
    !$OMP SIMD                                                                                                 
      DO j = xl, xh
        r = r + c
      ENDDO
    ENDDO
    !$OMP END DO                                                                                               
    !$OMP END PARALLEL                                                                                         

  END SUBROUTINE kernel

END MODULE kernel_module
@EugeneZelenko EugeneZelenko added flang Flang issues not falling into any other category and removed new issue labels Feb 5, 2024
@kiranchandramohan
Copy link
Contributor

This seems to work correctly now with a build after #80019. Please check and close if it works fine.

@EugeneZelenko EugeneZelenko added flang:ir and removed flang Flang issues not falling into any other category labels Feb 16, 2024
@llvmbot
Copy link
Member

llvmbot commented Feb 16, 2024

@llvm/issue-subscribers-flang-ir

Author: Kei Davis (keidavis)

Reproducer below. LLVM project source updated Feb 5 2024.

flang-new -fopenmp -c <file>

Interestingly, the crash goes away if !$OMP SIMD is removed.

MODULE kernel_module

CONTAINS

  SUBROUTINE kernel

    IMPLICIT NONE

    INTEGER :: xl, xh, yl, yh
    REAL    :: r

    INTEGER :: j, k
    REAL    :: c

    xl = 0 ; xh = 1 ; yl = 0 ; yh = 1
    r = 0.0 ; c = 0.0

    !$OMP PARALLEL                                                                                             
    !$OMP DO PRIVATE(c) REDUCTION(+ : r)                                                                       
    DO k = yl, yh
    !$OMP SIMD                                                                                                 
      DO j = xl, xh
        r = r + c
      ENDDO
    ENDDO
    !$OMP END DO                                                                                               
    !$OMP END PARALLEL                                                                                         

  END SUBROUTINE kernel

END MODULE kernel_module

@keidavis
Copy link
Author

Yes, it works correctly now (LLVM pulled Feb 15 2024), and also in the original app where the bug was first detected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants