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][OpenMP] Use simdloop operation only for omp simd pragma #19

Commits on Jan 25, 2024

  1. [Flang][OpenMP] Use simdloop operation only for omp simd pragma

    OpenMP standard differentiates between omp simd (2.9.3.1) and
    omp do/for simd (2.9.3.2 for OpenMP 5.0 standard) pragmas.
    The first one describes the loop which needs to be vectorized.
    The second pragma describes the loop which needs to be workshared
    between existing threads. Each thread can use SIMD instructions
    to execute its chunk of the loop.
    
    That's why we need to model
    !$omp simd
      do-loop
    as omp.simdloop operation and add compiler hints for vectorization.
    
    The worksharing loop:
    !$omp do simd
      do-loop
    should be represented as worksharing loop.
    
    Currently Flang denotes both type of OpenMP pragmas by omp.simdloop
    operation. In consequence we cannot differentiate between:
    !$omp parallel simd
       do-loop
    and
    !$omp parallel do simd
       do-loop
    The second loop should be workshared between multiple threads.
    The first one describes the loop which needs to be redundantly
    executed by multiple threads. Current Flang implementation
    does not perform worksharing for `!$omp do simd` pragma and
    generates valid code only for first case.
    DominikAdamski committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    3bc8b58 View commit details
    Browse the repository at this point in the history