[all-commits] [llvm/llvm-project] 7095a8: [flang][hlfir] Fixed where/elsewhere mask saving i...

Slava Zakharin via All-commits all-commits at lists.llvm.org
Fri Aug 4 09:20:02 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7095a86fc3a85cef759f4210933b5f2fbe8444c2
      https://github.com/llvm/llvm-project/commit/7095a86fc3a85cef759f4210933b5f2fbe8444c2
  Author: Slava Zakharin <szakharin at nvidia.com>
  Date:   2023-08-04 (Fri, 04 Aug 2023)

  Changed paths:
    M flang/lib/Optimizer/HLFIR/Transforms/ScheduleOrderedAssignments.cpp
    M flang/test/HLFIR/order_assignments/forall-scheduling.f90
    M flang/test/HLFIR/order_assignments/where-scheduling.f90

  Log Message:
  -----------
  [flang][hlfir] Fixed where/elsewhere mask saving in case of conflicts.

The assignments inside where/elsewhere may affect variables participating
in the mask expression, but execution of the assignments must not affect
the established control mask(s) (F'18 10.2.3.2 p. 13).

The following example must print all 42's:
```
program test
  integer c(3)
  logical :: mask(3) = .true.
  where (mask)
     c = f()
  end where
  print *, c
contains
  integer function f()
    mask = .false.
    f = 42
  end function f
end program test
```

Reviewed By: tblah

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




More information about the All-commits mailing list