[all-commits] [llvm/llvm-project] dc4bf2: [flang][OpenMP]Make omp.wsloop arguments appear in...

Mats Petersson via All-commits all-commits at lists.llvm.org
Wed Jun 1 09:21:20 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: dc4bf2c33ce48ab03ba2a497e4d2c875162b0435
      https://github.com/llvm/llvm-project/commit/dc4bf2c33ce48ab03ba2a497e4d2c875162b0435
  Author: Mats Petersson <6831237+Leporacanthicus at users.noreply.github.com>
  Date:   2022-06-01 (Wed, 01 Jun 2022)

  Changed paths:
    M flang/lib/Lower/OpenMP.cpp
    M flang/test/Lower/OpenMP/omp-parallel-wsloop.f90
    M flang/test/Lower/OpenMP/omp-unstructured.f90
    M flang/test/Lower/OpenMP/omp-wsloop-chunks.f90
    M flang/test/Lower/OpenMP/omp-wsloop-collapse.f90
    M flang/test/Lower/OpenMP/omp-wsloop-variable.f90
    M flang/test/Lower/OpenMP/omp-wsloop.f90

  Log Message:
  -----------
  [flang][OpenMP]Make omp.wsloop arguments appear in memory (#1277)

As per issue #1196, the loop induction variable, which is an argument
in the omp.wsloop operation, does not have a memory location, so when
passed to a function or subroutine, the reference to the value is not
a memory location, but the value of the induction variable. The callee
function/subroutine is then trying to dereference memory at address 1
or some other "not a good memory location".

This is fixed by creating a temporary memory location and storing the
value of the induction variable in that.

Test fixes as a consequence of the changed code generated.

Add checking for some of the omp-unstructured.f90 to check for alloca,
store and load operations, to ensure the correct flow. Add a test
for CYCLE inside a omp-do loop.

Also convert to use -emit-fir in the omp-unstructrued, and make
the symbol matching consistent in the omp-wsloop-variable test.

Reviewed By: peixin

Differential Revision: https://reviews.llvm.org/D126711




More information about the All-commits mailing list