Commit Graph

4679 Commits

Author SHA1 Message Date
Valentin Clement 656b8d6c01
[flang][NFC] Add array lowering tests
These tests were left behind during the upstreaming of parts lowering.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: jeanPerier

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

Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
2022-06-27 14:19:54 +02:00
Andrzej Warzynski 869385b11c [flang][driver] Add support for `-O{0|1|2|3}`
This patch adds support for most common optimisation compiler flags:
`-O{0|1|2|3}`. This is implemented in both the compiler and frontend
drivers. At this point, these options are only used to configure the
LLVM optimisation pipelines (aka middle-end). LLVM backend or MLIR/FIR
optimisations are not supported yet.

Previously, the middle-end pass manager was only required when
generating LLVM bitcode (i.e. for `flang-new -c -emit-llvm <file>` or
`flang-new -fc1 -emit-llvm-bc <file>`). With this change, it becomes
required for all frontend actions that are represented as
`CodeGenAction` and `CodeGenAction::executeAction` is refactored
accordingly (in the spirit of better code re-use).

Additionally, the `-fdebug-pass-manager` option is enabled to facilitate
testing. This flag can be used to configure the pass manager to print
the middle-end passes that are being run. Similar option exists in Clang
and the semantics in Flang are identical. This option translates to
extra configuration when setting up the pass manager. This is
implemented in `CodeGenAction::runOptimizationPipeline`.

This patch also adds some bolier plate code to manage code-gen options
("code-gen" refers to generating machine code in LLVM in this context).
This was extracted from Clang. In Clang, it simplifies defining code-gen
options and enables option marshalling. In Flang, option marshalling is
not yet supported (we might do at some point), but being able to
auto-generate some code with macros is beneficial. This will become
particularly apparent when we start adding more options (at least in
Clang, the list of code-gen options is rather long).

Differential Revision: https://reviews.llvm.org/D128043
2022-06-27 10:06:14 +00:00
Andrzej Warzynski 88c4a4a6be [flang] Update the release notes
Document changes introduced in https://reviews.llvm.org/D126164.

Differential Revision: https://reviews.llvm.org/D128413
2022-06-27 09:19:37 +00:00
Kazu Hirata dc97886fa3 [flang] Restore Optional::value() (NFC)
This patch restores several calls to Optional::value() in preference
to Optional::operator*.

The Flang C++ Style Guide tells us to use x.value() where no presence
test is obviously protecting a *x reference to the contents.

Differential Revision: https://reviews.llvm.org/D128590
2022-06-25 13:21:34 -07:00
Kazu Hirata 3b7c3a654c Revert "Don't use Optional::hasValue (NFC)"
This reverts commit aa8feeefd3.
2022-06-25 11:56:50 -07:00
Kazu Hirata aa8feeefd3 Don't use Optional::hasValue (NFC) 2022-06-25 11:55:57 -07:00
Valentin Clement 575eb2133b
[flang] Use descriptors for real/complex input other than kinds 4 and 8
This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: PeteSteinfeld, vdonaldson

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

Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
2022-06-25 09:19:34 +02:00
Valentin Clement d7ab38f8f4
[flang][OpenACC] Lower parallel loop
Lower the `parallel loop` contrsuct and refactor some of the code
of parallel and loop lowering to be reused.

Also add tests for loop and parallel since they were not upstreamed.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: PeteSteinfeld

Differential Revision: https://reviews.llvm.org/D128510
2022-06-24 21:06:21 +02:00
Valentin Clement 56c81d2554
[flang][lowering] handle MERGE with different FSOURCE and TSOURCE types
In merge FSOURCE and TSOURCE must have the same Fortran dynamic types,
but this does not imply that FSOURCE and TSOURCE will be lowered to the
same MLIR types. For instance, TSOURCE may be a character expression
with a compile type constant length (!fir.char<1,4>) while FSOURCE may
have dynamic length (!fir.char<1,?>).

Cast FSOURCE to TSOURCE MLIR types to handle these cases.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: PeteSteinfeld

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
2022-06-24 21:05:15 +02:00
Valentin Clement d45d707434
[flang] Explicitly map host associated symbols
Explicitly map host associated symbols in DoConcurrent with shared
locality-spec, clauses in OpenMP/OpenACC. The mapping of host-assoc
symbols is set to their parent SymbolBox. This is achieved through
a new interface function in the AbstractConverter.

This was already upstream for OpenMP.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: PeteSteinfeld

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

Co-authored-by: Kiran Chandramohan <kiran.chandramohan@arm.com>
2022-06-24 21:03:49 +02:00
Valentin Clement 4489ef8e34
[flang] Fix LBOUND with assumed size array and non constant DIM
LBOUND with a non constant DIM argument use the runtime to allow runtime
verification of DIM <= RANK. The interface uses a descriptor. This caused
undefined behavior because the runtime believed it was seeing an explicit
shape arrays with zero extent and returned `1` (the runtime descriptor
does not allow making a difference between an explicit shape and an
assumed size. Assumed size are not meant to be described by runtime
descriptors).

Fix the issue by setting the last extent of assumed size to `1` when
creating the descriptor to inquire about the LBOUND with the runtime.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: PeteSteinfeld

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
2022-06-24 21:02:07 +02:00
Kiran Chandramohan 703b1054e9 [Flang] enable fir.is_present and fir.absent with function types
Fortran dummy procedures and procedure pointer can be OPTIONAL, and
there is no technical reason to prevent fir.is_present and
fir.absent from accepting function types, so allow it and add test.

Note: This is part of upstreaming from the fir-dev branch of
https://github.com/flang-compiler/f18-llvm-project. This patch is
basically upstreaming the following PR.
https://github.com/flang-compiler/f18-llvm-project/pull/1568

Reviewed By: clementval

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
2022-06-24 08:46:14 +00:00
Peixin-Qiao 27afb362b1 [flang][OpenMP] Initial support the lowering of copyin clause
This supports the lowering of copyin clause initially. The pointer,
allocatable, common block, polymorphic varaibles will be supported
later.

This also includes the following changes:

1. Resolve the COPYIN clause and make the entity as host associated.

2. Fix collectSymbolSet by adding one option to control collecting the
   symbol itself or ultimate symbol of it so that it can be used
   explicitly differentiate the host and associated variables in
   host-association.

3. Add one helper function `lookupOneLevelUpSymbol` to differentiate the
   usage of host and associated variables explicitly. The previous
   lowering of firstprivate depends on the order of
   `createHostAssociateVarClone` and `lookupSymbol` of host symbol. With
   this fix, this dependence is removed.

4. Reuse `copyHostAssociateVar` for copying operation of COPYIN clause.

Reviewed By: kiranchandramohan, NimishMishra

Differential Revision: https://reviews.llvm.org/D127468
2022-06-24 15:33:09 +08:00
Valentin Clement aeb2cd3176
[flang] Keep PURE in IEEE functions
PURE keyword should be kept in `__fortran_ieee_exceptions.f90`
and `ieee_arithmetic.f90` and not removed as done in
https://reviews.llvm.org/D128431

Reviewed By: vdonaldson

Differential Revision: https://reviews.llvm.org/D128498
2022-06-24 09:10:18 +02:00
Valentin Clement 753b766dea
[flang] Fix forall issue with substring operation
When there is a substring operation on a scalar assignment in a FORALL
context, we have to lower the entire substring and not the entire
CHARACTER variable.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: PeteSteinfeld, klausler

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

Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
2022-06-24 09:07:49 +02:00
Peter Klausler df6afee985 [flang][runtime] Improve G0 output editing
G0 output editing should never overflow an output field and fill it
with asterisks.  It should also never elide the "E" in an exponent
field, even if it has more than three digits.

Differential Revision: https://reviews.llvm.org/D128396
2022-06-23 11:27:25 -07:00
Peter Klausler 1ef5e6de76 [flang] Make SQRT folding exact
Replace the latter half of the SQRT() folding algorithm with code that
calculates an exact root with extra rounding bits, and then lets the
usual normalization and rounding code do the right thing.  Extend
tests to catch regressions.

Differential Revision: https://reviews.llvm.org/D128395
2022-06-23 11:16:39 -07:00
Peter Klausler dfaa3880e1 [flang] Fix wording of warning message
"division on intrinsic call" should read "division by zero on intrinsic call".

Differential Revision: https://reviews.llvm.org/D128394
2022-06-23 11:15:35 -07:00
Peter Klausler c078e464a0 [flang][runtime] FLUSH(bad or unconnected unit number) is an error
Some I/O control statements are no-ops when attempted on a bad or
unconnected UNIT=, but the standard says that FLUSH is an error
in that case.

Differential Revision: https://reviews.llvm.org/D128392
2022-06-23 11:08:53 -07:00
Peter Klausler b6fce8b92d [flang] Fix bogus errors from SIZE/SHAPE/UBOUND on assumed-shape
While it is indeed an error to use SIZE, SHAPE, or UBOUND on an
assumed-shape dummy argument without also supplying a DIM= argument
to the intrinsic function, it is *not* an error to use these intrinsic
functions on sections or expressions of such arrays.  Refine the test
used for the error message.

Differential Revision: https://reviews.llvm.org/D128391
2022-06-23 10:32:22 -07:00
Peter Klausler ede4213169 [flang][runtime] Handle READ of non-UTF-8 data into multi-byte CHARACTER
When a READ statement reads into a CHARACTER(2 or 4) variable from a
unit whose encoding is not UTF-8, don't copy bytes directly; they must
each be zero-extended.

Differential Revision: https://reviews.llvm.org/D128390
2022-06-23 10:02:14 -07:00
Peter Klausler 1650fb8a53 [flang][runtime] Respect PAD='NO' on READ/WRITE
The check for the PAD= setting should examine the mutable modes
of the current I/O statement, not the persistent modes of the
I/O unit.

Differential Revision: https://reviews.llvm.org/D128389
2022-06-23 09:50:22 -07:00
Peter Klausler d771245a9d [flang] Fix READ/WRITE with POS= on stream units, with refactoring
First, ExternalFileUnit::SetPosition was being used both as a utility
within the class' member functions as well as an API from I/O statement
processing.  Make it private, and add APIs for SetStreamPos and SetDirectRec.

Second, ensure that SetStreamPos for POS= positioning in a stream
doesn't leave the current record number and endfile record number
in an arbitrary state.  In stream I/O they are used only to manage
end-of-file detection, and shouldn't produce false positive results
from IsAtEnd() after repositioning.

Differential Revision: https://reviews.llvm.org/D128388
2022-06-23 09:16:49 -07:00
Valentin Clement 734ad031f1
[flang] Handle boxed characters that are values when doing a conversion
Character conversion requires memory storage as it operates on a
sequence of code points.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: PeteSteinfeld

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

Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
2022-06-23 18:05:24 +02:00
Val Donaldson 124338dd80
[flang] Increase support for intrinsic module procedures
* Make Semantics test doconcurrent01.f90 an expected failure pending a fix
for a problem in recognizing a PURE prefix specifier for a specific procedure
that occurs in new intrinsic module source code,

* review update

* review update

* Increase support for intrinsic module procedures

The f18 standard defines 5 intrinsic modules that define varying numbers
of procedures, including several operators:

  2  iso_fortran_env
 55  ieee_arithmetic
 10  ieee_exceptions
  0  ieee_features
  6  iso_c_binding

There are existing fortran source files for each of these intrinsic modules.
This PR adds generic procedure declarations to these files for procedures
that do not already have them, together with associated specific procedure
declarations.  It also adds the capability of recognizing intrinsic module
procedures in lowering code, making it possible to use existing language
intrinsic code generation for intrinsic module procedures for both scalar
and elemental calls.  Code can then be generated for intrinsic module
procedures using existing options, including front end folding, direct
inlining, and calls to runtime support routines.  Detailed code generation
is provided for several procedures in this PR, with others left to future PRs.
Procedure calls that reach lowering and don't have detailed implementation
support will generate a "not yet implemented" message with a recognizable name.

The generic procedures in these modules may each have as many as 36 specific
procedures.  Most specific procedures are generated via macros that generate
type specific interface declarations.  These specific declarations provide
detailed argument information for each individual procedure call, similar
to what is done via other means for standard language intrinsics.  The
modules only provide interface declarations.  There are no procedure
definitions, again in keeping with how language intrinsics are processed.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: jeanPerier, PeteSteinfeld

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

Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
2022-06-23 18:03:48 +02:00
Valentin Clement ab89c132b5
[flang] Add lowering TODO for separate module procedures
MODULE FUNCTION and MODULE SUBROUTINE currently cause lowering crash:
"symbol is not mapped to any IR value" because special care is needed
to handle their interface.

Add a TODO for now.

Example of program that crashed and will hit the TODO:

```
module mod
  interface
    module subroutine sub
    end subroutine
  end interface
contains
  module subroutine sub
    x = 42
  end subroutine
end module
```

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: jeanPerier

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
2022-06-23 14:57:58 +02:00
Valentin Clement ea38744372
[flang] Lowering passing variables to OPTIONAL VALUE
The case where the dummy argument is OPTIONAL was missing in the
handling of VALUE numerical and logical dummies (passBy::BaseAddressValueAttribute).
This caused segfaults while unconditionally copying actual arguments that were legally
absent at runtime.

Takes this bug as an opportunity to share the code that lowers arguments
that must be passed by BaseAddress, BaseAddressValueAttribute, BoxChar,
and CharBoxValueAttribute.
It has to deal with the exact same issues (being able to make contiguous
copies of the actual argument, potentially conditionally at runtime,
and potentially requiring a copy-back).
The VALUE case is the same as the non value case, except there is never
a copy-back and there is always a copy-in for variables. This two
differences are easily controlled by a byValue flag.

This as the benefit of implementing CHARACTER, VALUE for free that was
previously a hard TODO.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: kiranchandramohan

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
2022-06-23 13:45:40 +02:00
Kiran Chandramohan c995038c27 [Flang] Call the CSE pass in the pass pipeline
During the upstreaming process, it was decided to move contents
of the FIR CSE pass to the MLIR pass. Most of the FIR CSE changes
that are used are already moved to the MLIR pass. This patch calls
the MLIR CSE pass in places where the FIR CSE pass is called in the
pass pipeline.

Note: This is part of upstreaming from the fir-dev branch of
https://github.com/flang-compiler/f18-llvm-project.

Reviewed By: awarzynski, clementval

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

Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: Valentin Clement <clementval@gmail.com>
Co-authored-by: Andrzej Warzynski <andrzej.warzynski@arm.com>
2022-06-23 11:04:39 +00:00
Valentin Clement b690597936
[flang] Fixes several bugs relating to initialization expressions. An ()
Fixes several bugs relating to initialization expressions. An
initialization expression has no access to dynamic resources like the
stack or the heap. It must reduce to a relocatable expression that the
loader can complete at runtime.

Adds regression test.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: PeteSteinfeld

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
2022-06-23 06:55:33 +02:00
Valentin Clement 24e8cf45a3
[flang] Capture result interface of functions called in internal procedures
Character and array results are allocated on the caller side. This
require evaluating the result interface on the call site. When calling
such functions inside an internal procedure, it is possible that the
interface is defined in the host, in which case the lengths/bounds of
the function results must be captured so that they are available in
the internal function to emit the call.

To handle this case, extend the PFT symbol visit to visit the bounds and length
parameters of functions called in the internal procedure parse tree.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: klausler

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
2022-06-22 22:32:52 +02:00
Valentin Clement 1c7889ca4d
[flang] Remove some auto
This patch replaces some `auto` with proper type. This was done in fir-dev
but not upstreamed yet.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: klausler

Differential Revision: https://reviews.llvm.org/D128350
2022-06-22 20:48:01 +02:00
Valentin Clement 10b23ae880
[flang] Handle BINC(C) variables and add TODO for corner cases
- BIND(C) was ignored in lowering for objects (it can be used on
module and common blocks): use the bind name as the fir.global name.

- When an procedure is declared BIND(C) indirectly via an interface,
  it should have a BIND(C) name. This was not the case because
  GetBindName()/bindingName() return nothing in this case: detect this
  case in mangler.cpp and use the symbol name.

Add TODOs for corner cases:

- BIND(C) module variables may be initialized on the C side. This does
  not fit well with the current linkage strategy. Add a TODO until this
  is revisited.

- BIND(C) internal procedures should not have a binding label (see
  Fortran 2018 section 18.10.2 point 2), yet we currently lower them as
  if they were BIND(C) external procedure.
  I think this and the indirect interface case should really be
  handled by symbol.GetBindName instead of adding more logic in
  lowering to deal with this case: add a TODO.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: klausler

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
2022-06-22 20:47:23 +02:00
Peixin Qiao 3fa62efdbb [flang] Add semantic check for C1520
As Fortran 2018 C1520, if proc-language-binding-spec with NAME= is
specified, then proc-decl-list shall contain exactly one proc-decl,
which shall neither have the POINTER attribute nor be a dummy procedure.
Add this check.

Reviewed By: klausler

Differential Revision: https://reviews.llvm.org/D127725
2022-06-23 00:04:24 +08:00
Peixin Qiao 430841605d [flang][Driver] Refine _when_ driver diagnostics are formatted
This patch refines //when// driver diagnostics are formatted so that
`flang-new` and `flang-new -fc1` behave consistently with `clang` and
`clang -cc1`, respectively. This change only applies to driver diagnostics.
Scanning, parsing and semantic diagnostics are separate and not covered here.

**NEW BEHAVIOUR**
To illustrate the new behaviour, consider the following input file:
```! file.f90
program m
  integer :: i = k
end
```
In the following invocations, "error: Semantic errors in file.f90" _will be_
formatted:
```
$ flang-new file.f90
error: Semantic errors in file.f90
./file.f90:2:18: error: Must be a constant value
    integer :: i = k
$ flang-new -fc1 -fcolor-diagnostics file.f90
error: Semantic errors in file.f90
./file.f90:2:18: error: Must be a constant value
    integer :: i = k
```

However, in the following invocations, "error: Semantic errors in file.f90"
_will not be_ formatted:
```
$ flang-new -fno-color-diagnostics file.f90
error: Semantic errors in file.f90
./file.f90:2:18: error: Must be a constant value
    integer :: i = k
$ flang-new -fc1 file.f90
error: Semantic errors in file.f90
./file.f90:2:18: error: Must be a constant value
    integer :: i = k
```

Before this change, none of the above would be formatted. Note also that the
default behaviour in `flang-new` is different to `flang-new -fc1` (this is
consistent with Clang).

**NOTES ON IMPLEMENTATION**
Note that the diagnostic options are parsed in `createAndPopulateDiagOpt`s in
driver.cpp. That's where the driver's `DiagnosticEngine` options are set. Like
most command-line compiler driver options, these flags are "claimed" in
Flang.cpp (i.e.  when creating a frontend driver invocation) by calling
`getLastArg` rather than in driver.cpp.

In Clang's Options.td, `defm color_diagnostics` is replaced with two separate
definitions: `def fcolor_diagnostics` and def fno_color_diagnostics`. That's
because originally `color_diagnostics` derived from `OptInCC1FFlag`, which is a
multiclass for opt-in options in CC1. In order to preserve the current
behaviour in `clang -cc1` (i.e. to keep `-fno-color-diagnostics` unavailable in
`clang -cc1`) and to implement similar behaviour in `flang-new -fc1`, we can't
re-use `OptInCC1FFlag`.

Formatting is only available in consoles that support it and will normally mean that
the message is printed in bold + color.

Co-authored-by: Andrzej Warzynski <andrzej.warzynski@arm.com>

Reviewed By: rovka

Differential Revision: https://reviews.llvm.org/D126164
2022-06-22 23:56:34 +08:00
Peixin Qiao f31ec689b2 [NFC][flang] Add the test case for D125371
This adds the test case with portability warning preparing for D125804,
which supports checking for portability warnings in test_errors.py.

Reviewed By: ekieri

Differential Revision: https://reviews.llvm.org/D127821
2022-06-22 23:53:38 +08:00
Valentin Clement 1906188f07
[flang] Add FIR tests missing from fir-dev
This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: jeanPerier, PeteSteinfeld

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: Kiran Chandramohan <kiran.chandramohan@arm.com>
2022-06-22 15:35:04 +02:00
Valentin Clement b09426ff26
[flang] Cleanup code and add test from fir-dev
This patch clean up some code for upstreaming and add couple of
missing tests that were left in fir-dev.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: jeanPerier, PeteSteinfeld

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
2022-06-22 09:39:11 +02:00
Valentin Clement c67a87444f
[flang] Add more diagnostics to fir.coordinate_of
Add more diagnostics to fir.coordinate_of to provide better checking
that the IR is sane.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: PeteSteinfeld

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

Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
2022-06-21 20:43:22 +02:00
Kazu Hirata ed8fceaa09 Don't use Optional::getValue (NFC) 2022-06-20 23:35:53 -07:00
Shraiysh Vaishay c858f4dbd5 [flang][OpenMP] Fix firstprivate with barrier
This patch fixes the unintentional data race in firstprivate
implementation. There is a Read-Write race when one thread tries
to copy the value inside the omp.parallel region while other
thread modifies it from inside the region (using pointers or
some other form of indirect access).

For detailed discussion please refer to [[ https://discourse.llvm.org/t/issues-with-the-current-implementation-of-privatization-in-openmp-with-fortran/62335 | discourse ]].

Reviewed By: kiranchandramohan, peixin, NimishMishra

Differential Revision: https://reviews.llvm.org/D125689
2022-06-21 10:06:05 +05:30
Kazu Hirata 0916d96d12 Don't use Optional::hasValue (NFC) 2022-06-20 20:17:57 -07:00
Kazu Hirata 064a08cd95 Don't use Optional::hasValue (NFC) 2022-06-20 20:05:16 -07:00
Kazu Hirata 5413bf1bac Don't use Optional::hasValue (NFC) 2022-06-20 11:33:56 -07:00
Valentin Clement 331145e6e9
[flang][NFC] Unify todo messages
This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: jeanPerier

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

Co-authored-by: Peter Steinfeld <psteinfeld@nvidia.com>
2022-06-20 15:44:20 +02:00
Valentin Clement 8ac4eb918c
[flang][NFC] Fix file name typos 2022-06-20 12:32:23 +02:00
Alex Zinenko 8b68da2c7d [mlir] move SCF headers to SCF/{IR,Transforms} respectively
This aligns the SCF dialect file layout with the majority of the dialects.

Reviewed By: jpienaar

Differential Revision: https://reviews.llvm.org/D128049
2022-06-20 10:18:01 +02:00
Daniil Dudkin 4f1fa558c8 [flang][NFC] Small refactor for `IsProcedurePointer`
Instead of manually checking for procedure-like details in Symbol,
defer it to IsProcedure function.

Differential Revision: https://reviews.llvm.org/D127967
2022-06-20 11:10:30 +03:00
Diana Picus 26041e1700 Update link job for flang on windows
When linking a Fortran program, we need to add the runtime libraries to
the command line. This is exactly what we do for Linux/Darwin, but the
MSVC interface is slightly different (e.g. -libpath instead of -L).

We also remove oldnames and libcmt, since they're not needed at the
moment and they bring in more dependencies.

We also pass `/subsystem:console` to the linker so it can figure out the
right entry point. This is only needed for MSVC's `link.exe`. For LLD it
is redundant but doesn't hurt.

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

Co-authored-by: Markus Mützel <markus.muetzel@gmx.de>
2022-06-20 07:25:10 +00:00
Kazu Hirata 30c675878c Use value_or instead of getValueOr (NFC) 2022-06-19 10:34:41 -07:00
Nimish Mishra c05b99971f [flang][OpenMP][NFC] Refactor code related to OpenMP atomic memory order clause semantics
Reviewed By: peixin

Differential Revision: https://reviews.llvm.org/D127822
2022-06-19 22:36:40 +05:30