7 Commits

Author SHA1 Message Date
Kareem Ergawy
97e17e1595
Revert "[flang] Enable delayed localization by default for do concurrent (#144074)" (#144476)
This reverts commit b5dbf8210a57b986b9802304745f4c5c108cf37b.

Reverting again due to gfortran failure:
https://lab.llvm.org/buildbot/#/builders/17/builds/8868
2025-06-17 11:34:05 +02:00
Kareem Ergawy
b5dbf8210a
[flang] Enable delayed localization by default for do concurrent (#144074)
Reintroduces changes from
https://github.com/llvm/llvm-project/issues/143897. A fix for the
reported problem in https://github.com/llvm/llvm-project/issues/143897
is hopefully resolved in
https://github.com/llvm/llvm-project/pull/144027.

This PR aims to make it easier and more self-contained to revert the
switch/flag if we discover any problems with enabling it by default.
2025-06-17 06:08:38 +02:00
Kareem Ergawy
4bd0a0e50b
Revert "[flang] Enable delayed localization by default for do concurrent (#142567)" (#143905)
This reverts commit 937be177528de156922c1b5f6cab08ba3009dbf2.

Resolves https://github.com/llvm/llvm-project/issues/143897 until the
todo is properly handled.
2025-06-12 17:09:55 +02:00
Kareem Ergawy
937be17752
[flang] Enable delayed localization by default for do concurrent (#142567)
This PR aims to make it easier and more self-contained to revert the
switch/flag if we discover any problems with enabling it by default.
2025-06-11 10:10:22 +02:00
jeanPerier
6a41f53c39
[flang][hlfir] do not propagate polymorphic temporary as allocatables (#142609)
Polymorphic temporary are currently propagated as
fir.ref<fir.class<fir.heap<>>> because their allocation may be delayed
to the hlfir.assign copy (using realloc).

This patch moves away from this and directly allocate the temp and
propagate it as a fir.class.

The polymorphic temporaries creating is also simplified by avoiding the
need to call the runtime to setup the descriptor altogether (the runtime
is still call for the allocation currently because alloca/allocmem do
not support polymorphism).
2025-06-06 09:53:41 +02:00
Kareem Ergawy
bac4aa440c
[flang] Extend localization support for do concurrent (init regions) (#142564)
Extends support for locality specifiers in `do concurrent` by supporting
data types that need `init` regions.

This further unifies the paths taken by the compiler for OpenMP
privatization clauses and `do concurrent` locality specifiers.
2025-06-05 01:01:53 +02:00
Kareem Ergawy
fd66fa56c4
[flang] Retrieve shape from selector when generating assoc sym type (#137117)
This PR extends `genSymbolType` so that the type of an associating
symbol carries the shape of the selector expression, if any. This is a
fix for a bug that triggered when an associating symbol is used in a
locality specifier. For example, given the following input:

```fortran
  associate(a => aa(4:))
    do concurrent (i = 4:11) local(a)
      a(i) = 0
    end do
  end associate
```
before the changes in the PR, flang would assert that we are casting
between incompatible types. The issue happened since for the associating
symbol (`a`), flang generated its type as `f32` rather than
`!fir.array<8xf32>` as it should be in this case.
2025-06-02 15:49:58 +02:00