1. Aug 21, 2022
  2. Aug 20, 2022
    • Kazu Hirata's avatar
      fc4d3a11
    • Peixin Qiao's avatar
      [flang] Add semantic checks for interoperability of derived type (C1806) · 6d1a6851
      Peixin Qiao authored
      As Fortran 2018 C1806, each component of a derived type with the BIND
      attribute shall be a nonpointer, nonallocatable data component with
      interoperable type.
      
      Reviewed By: klausler
      
      Differential Revision: https://reviews.llvm.org/D131585
      6d1a6851
    • Peixin Qiao's avatar
      [flang][OpenMP] Handle the data race for firstprivate and lastprivate · aa414603
      Peixin Qiao authored
      Remove barriers for firstprivate except if the variable is also
      lastprivatized. Re-arrange code and put all last-privates inside a
      single scf.if.
      
      As OpenMP Spec 5.0, to avoid the data races, concurrent updates of the
      original list item must be synchronized with the read of the original
      list item that occurs as a result of the firstprivate clause. Adding
      barrier(s) before and/or after the worksharing region would remove the
      data races, and it is the application(user)'s job. However, when
      one list item is in both firstprivate and lastprivate clauses, the
      standard (https://www.openmp.org/spec-html/5.0/openmpsu105.html) states
      the following:
      ```
      If a list item appears in both firstprivate and lastprivate clauses, the
      update required for the lastprivate clause occurs after all
      initializations for the firstprivate clause.
      ```
      
      So, the synchronization should be ensured by compiler such as emiting
      one barrier since the lastprivate clause follows the reads of the
      original list item performed for the initialization of each of the
      firstprivate list item.
      
      Add FIXME for two special cases, sections construct and linear clause.
      
      The data race problem for single construct will be handled later.
      
      This implementation is based on the discussion with OpenMP committee and
      clang code (clang/lib/CodeGen/CGStmtOpenMP.cpp).
      
      Reviewed By: kiranchandramohan, NimishMishra
      
      Differential Revision: https://reviews.llvm.org/D131832
      aa414603
    • Kazu Hirata's avatar
      347c462e