Commit graph

4197 commits

Author SHA1 Message Date
Valentin Clement 3de6b1ce0d
[flang][NFC] Add pointer dummy arguments tests
This patch adds test for calls with POINTER dummy arguments on the caller side.

It also fixes some formatting error that was introduced when upstreaming
the other pointer tests.

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

Reviewed By: PeteSteinfeld

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
2022-03-22 20:57:15 +01:00
Peter Klausler bafbae238a [flang] Initial UTF-8 support in runtime I/O
Implements UTF-8 encoding and decoding for external units
with OPEN(ENCODING='UTF-8').  This encoding applies to default
CHARACTER values that are not 7-bit ASCII as well as to
the wide CHARACTER kinds 2 and 4.  Basic testing is in place
via direct calls to the runtime I/O APIs, but serious checkout
awaits lowering support of the wide CHARACTER kinds.

Differential Revision: https://reviews.llvm.org/D122038
2022-03-22 11:48:14 -07:00
Peter Klausler 54d19ba208 [flang] Fix crash: ENTRY with generic interface of the same name
Name resolution was crashing while processing the ENTRY statement
due to a lack of special-case code necessary to handle the indirection
needed when the generic has the same name as the ENTRY.

Differential Revision: https://reviews.llvm.org/D122050
2022-03-22 11:10:30 -07:00
Valentin Clement 74f992929e
[flang][NFC] Remove unused variable
Fix for buildbot failure shown after fe252f8ed6
2022-03-22 16:13:03 +01:00
Kiran Chandramohan fea20cb990 [Flang] Lower the sqrt intrinsics
The intrinsic computes the square root for real and complex numbers. By
default they are lowered to runtime calls to libpgmath. With the llvm
option, it can be lowered to llvm intrinsics (not all types .eg. complex
are supported for llvm lowering).

This is part of the upstreaming effort from the fir-dev branch in [1].
[1] https://github.com/flang-compiler/f18-llvm-project

Reviewed By: schweitz

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

Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: Jean Perier <jperier@nvidia.com>
2022-03-22 15:05:21 +00:00
Valentin Clement fe252f8ed6
[flang] Lower boxed procedure
In FIR, we want to wrap function pointers in a special box known as a
boxproc value. Fortran has a limited form of dynamic scoping
[https://tinyurl.com/2p8v2hw7] between "host procedures" and "internal
procedures". There are a number of implementations possible.

Boxproc typed values abstract away the implementation details of when a
function pointer can be passed directly (as a raw address) and when a
function pointer has to account for the presence of a dynamic scope.
When lowering Fortran syntax to FIR, all function pointers are emboxed
as boxproc values.

When creating LLVM IR, we must strip away the abstraction and produce
low-level LLVM "assembly" code. This patch implements that
transformation as converting the boxproc values to either raw function
pointers or executable trampolines on the stack as needed. The
trampoline then captures the dynamic scope context within an executable
thunk that can be passed instead of the function's raw address.

Some extra handling is required for Fortran functions that return a
character value to deal with LEN values here.

Some of the code in Bridge.cpp and ConvertExpr.cpp and be re-arranged to
faciliate the upstreaming effort.

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

Reviewed By: jeanPerier, PeteSteinfeld

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

Co-authored-by: mleair <leairmark@gmail.com>
Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
Co-authored-by: Kiran Chandramohan <kiran.chandramohan@arm.com>
2022-03-22 15:41:11 +01:00
Kiran Chandramohan db925d08de [Flang] Lower the exp, log, log10 intrinsics
The intrinsic computes the exponent, log real and complex numbers and
log10 for real numbers. By default they are lowered to runtime calls to
libpgmath. kind=10 and 16 are not supported. With the llvm option, it
can be lowered to llvm intrinsics (not all types .eg. complex are
supported for llvm lowering).

This is part of the upstreaming effort from the fir-dev branch in [1].
[1] https://github.com/flang-compiler/f18-llvm-project

Reviewed By: PeteSteinfeld

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

Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: William S Moses <gh@wsmoses.com>
2022-03-22 14:04:27 +00:00
Shraiysh Vaishay ebec5e5c8f [flang][OpenMP] Lowering critical construct
This patch adds translation from PFT to FIR for critical construct.

This is part of the upstreaming effort from the fir-dev branch in [1].
[1] https://github.com/flang-compiler/f18-llvm-project

Co-authored-by: kiranchandramohan <kiranchandramohan@gmail.com>

Reviewed By: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D122218
2022-03-22 16:26:18 +05:30
Markus Böck e13d23bc6c [mlir] Rename OpAsmParser::OperandType to OpAsmParser::UnresolvedOperand
I am not sure about the meaning of Type in the name (was it meant be interpreted as Kind?), and given the importance and meaning of Type in the context of MLIR, its probably better to rename it. Given the comment in the source code, the suggestion in the GitHub issue and the final discussions in the review, this patch renames the OperandType to UnresolvedOperand.

Fixes https://github.com/llvm/llvm-project/issues/54446

Differential Revision: https://reviews.llvm.org/D122142
2022-03-21 21:42:13 +01:00
Peter Klausler 461b6fe470 [flang] Expose error recovery cases in external I/O
Some I/O error situations are current handled with fatal
runtime asserts, but should be exposed for user program
error recovery.

Differential Revision: https://reviews.llvm.org/D122049
2022-03-21 12:46:16 -07:00
Valentin Clement 5754bae429
[flang] Lower procedure designator
This patch adds lowering for procedure designator.

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

Reviewed By: PeteSteinfeld

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
2022-03-21 18:05:18 +01:00
Kiran Chandramohan c6ac937091 [Flang] Add OpenMP Conversion patterns
This patch adds the OpenMP conversion patterns to the FIR to LLVM
dialect lowering pass in Codegen. Appropriate legalization
conditions are also added. This ensures that a mix of FIR and OpenMP
dialects can be lowered to LLVM and OpenMP  dialects. Also adds two
tests.

This is part of the upstreaming effort from the fir-dev branch in [1].
[1] https://github.com/flang-compiler/f18-llvm-project

Reviewed By: clementval, peixin

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

Co-authored-by: Sourabh Singh Tomar <SourabhSingh.Tomar@amd.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
2022-03-21 14:23:02 +00:00
Peter Klausler 8db4dc8686 [flang] Error recovery improvement in runtime (IOMSG=)
Some refactoring and related fixes for more accurate
user program error recovery in the I/O runtime, especially
for error recovery with IOMSG= character values.

1) Move any work in an EndIoStatement() implementation
that may raise an error into a new CompleteOperation()
member function.  This allows error handling APIs like
GetIoMsg() to complete a pending I/O statement and harvest
any errors that may result.

2) Move the pending error code from ErroneousIoStatementState
to a new pendingError_ data member in IoErrorHandler.
This allows IoErrorHandler::InError() to return a correct
result when there is a pending error that will be recovered
from so that I/O list data transfers don't crash in the meantime.

3) Don't create and leak a unit for a failed OPEN(NEWUNIT=n)
with error recovery, and don't modify 'n'.  (Depends on
changes to API call ordering in lowering, in a separate patch;
code was added to ensure that OPEN statement control list
specifiers, e.g. SetFile(), must be passed before GetNewUnit().)

4) Fix the code that calls a form of strerror to fill an
IOMSG= variable so that it actually works for Fortran's
character type: blank fill with no null or newline termination.

Differential Revision: https://reviews.llvm.org/D122036
2022-03-18 17:24:32 -07:00
Peter Klausler b8f029c3a4 [flang] Accept legacy aliases for intrinsic function names
Support the names AND, OR, and XOR for the generic intrinsic
functions IAND, IOR, and IEOR respectively.

Differential Revision: https://reviews.llvm.org/D122034
2022-03-18 16:53:13 -07:00
Peter Klausler 251d062e4e [flang] Convert RUNTIME_CHECK to better error for user errors in transformational.cpp
In flang/runtime/transformational.cpp, there are many RUNTIME_CHECK assertions
for errors that should have been caught in semantics, but there are alno others
that signify program errors that in principle cannot be detected until
execution.  Convert this second group into readable fatal error messages.
Also clean up some missing braces and incorrect printf formats found
along the way.

Differential Revision: https://reviews.llvm.org/D122037
2022-03-18 16:52:43 -07:00
Peter Klausler 2d8b6a4784 [flang] Add explanatory messages to grammar for language extensions
Extend "extension<LanguageFeature>()" to incorporate an explanatory
message better than the current generic "nonstandard usage:".

Differential Revision: https://reviews.llvm.org/D122035
2022-03-18 16:14:27 -07:00
Shraiysh Vaishay ae1623b306 [flang][Parser] Add a node for individual sections in sections construct
This patch adds parser nodes for each indivudual section in sections
construct. This should help with the translation to FIR. `!$omp section`
was not recognized as a construct and hence needed special handling.

`OpenMPSectionsConstruct` contains a list of `OpenMPConstruct`. Each
such `OpenMPConstruct` wraps an `OpenMPSectionConstruct`
(section, not sections). An `OpenMPSectionConstruct` is a wrapper around
a `Block`.

Reviewed By: kiranchandramohan, peixin

Differential Revision: https://reviews.llvm.org/D121680
2022-03-18 21:55:35 +05:30
Valentin Clement 308fc3f277
[flang] Lower select case statement
This patch adds lowering for the `select case`
statement.

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

Reviewed By: jeanPerier

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
2022-03-18 15:41:29 +01:00
Valentin Clement 32306b9cf7
[flang] Lower length on character storage
This patch adds lowering for SetLength used to set
different length on character storage around calls where
the dummy and actual length differ.

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

Reviewed By: PeteSteinfeld

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
2022-03-18 14:52:59 +01:00
Valentin Clement 99d239341c
[flang][NFC] Add lowering tests
Add couple of tests for the lowering.

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

Reviewed By: PeteSteinfeld

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
2022-03-18 14:48:56 +01:00
Valentin Clement 460f828f09
[flang] Lower statement function
This patch adds lowering to suppoert statement functions

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

Reviewed By: PeteSteinfeld

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
2022-03-18 14:47:16 +01:00
Andrzej Warzynski 4571f8aa05 [flang][lowering] Add support for lowering of the ior intrinsic
This patch adds support for lowering of the `ior` intrinsic from
Fortran to the FIR dialect of MLIR.

This is part of the upstreaming effort from the `fir-dev` branch in [1].

[1] https://github.com/flang-compiler/f18-llvm-project

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
2022-03-18 10:36:38 +00:00
Andrzej Warzynski ff3e75f739 [flang][lowering] Add support for lowering of the {l|u}bound intrinsics
This patch adds support for lowering of the `{l|u}bound` intrinsics from
Fortran to the FIR dialect of MLIR. Note that `ubound` is already
supported, but the test was missing (added here).

This is part of the upstreaming effort from the `fir-dev` branch in [1].

[1] https://github.com/flang-compiler/f18-llvm-project

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: Peter Steinfeld <psteinfeld@nvidia.com>
2022-03-18 10:16:54 +00:00
Andrzej Warzynski 4d2096482d [flang][lowering] Add support for lowering of the merge intrinsics
This patch adds support for lowering of the `merge` intrinsics from
Fortran to the FIR dialect of MLIR.

This is part of the upstreaming effort from the `fir-dev` branch in [1].

[1] https://github.com/flang-compiler/f18-llvm-project

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

Co-authored-by: Valentin Clement <clementval@gmail.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: Mark Leair <leairmark@gmail.com>
Co-authored-by: Jean Perier <jperier@nvidia.com>
2022-03-18 10:09:40 +00:00
Kiran Chandramohan 022b05941e [Flang] Lower the spacing, rrspacing intrinsics
These intrinsics returns the distance to the nearest real number and
their reciprocal. They are lowered to flang runtime calls.

This is part of the upstreaming effort from the fir-dev branch in [1].
[1] https://github.com/flang-compiler/f18-llvm-project

Reviewed By: clementval

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

Co-authored-by: Mark Leair <leairmark@gmail.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: Jean Perier <jperier@nvidia.com>
2022-03-18 09:18:42 +00:00
Valentin Clement 7db0f6f2f3
[flang][NFC] Move random test in Instriscs folder 2022-03-18 09:25:14 +01:00
Valentin Clement d6d9a8b8a1
[flang] Lower more array expression
This patch adds more lowering for array expressions.

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

Reviewed By: PeteSteinfeld

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
2022-03-18 08:24:01 +01:00
Valentin Clement 518a837e93
[flang] Add array constructor lowering tests
This patch adds some tests for the lowering of
array constructors.

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

Reviewed By: PeteSteinfeld

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

Co-authored-by: mleair <leairmark@gmail.com>
Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
2022-03-17 21:40:37 +01:00
Andrzej Warzynski 00cdbd7845 [flang][nfc] Move a test
All option forwarding tests should be added to frontend-forwarding.f90
rather than files corresponding to various options. This patch moves
such test for `-mllvm` accordingly.
2022-03-17 16:47:54 +00:00
Valentin Clement 67b23feab2
[flang] Lower some numeric intrinsics
This patch adds lowering for the following numeric intrinsics:
- aint
- anint
- cmplx
- conjg
- dble
- dprod
- sign

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

Reviewed By: schweitz

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
2022-03-17 17:19:29 +01:00
Valentin Clement b00ba502dd
[flang] Add equivalence lowering tests
This patch adds couple of lwoering tests for equivalences

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

Reviewed By: schweitz

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
2022-03-17 17:16:19 +01:00
Valentin Clement baa42c1647
[flang] Add more lowering tests for dummy arguments
This patch adds more lowering tests for dummy arguments
and adds lowering for a specific case.

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

Reviewed By: schweitz

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
2022-03-17 17:14:57 +01:00
Valentin Clement d670e10235
[flang] Add IO lowering test
This patch adds more lowering tests for IO
Test lowering of IO read SIZE control-spec (12.6.2.15)

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

Reviewed By: jeanPerier

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

Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
2022-03-17 17:00:13 +01:00
Kiran Chandramohan 291913db53 [Flang] Lower the repeat intrinsic
The repeat intrinsic creates ncopies of a string. The lowering is to
a runtime call to a function in the flang library. The runtime allocates
the buffer to store the result string. This buffer is freed by code
added in the lowering.

This is part of the upstreaming effort from the fir-dev branch in [1].
[1] https://github.com/flang-compiler/f18-llvm-project

Reviewed By: clementval

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

Co-authored-by: Valentin Clement <clementval@gmail.com>
Co-authored-by: Jean Perier <jperier@nvidia.com>
2022-03-17 13:38:16 +00:00
Valentin Clement 2b55850df8
[flang] Lower command and environment intrinsics
This patch adds lowering for command and environment
related intrinsics:
- `get_command_argument`
- `get_environment_variable`
- `command_argument_count`

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

Reviewed By: PeteSteinfeld

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

Co-authored-by: Josh Mottley <Josh.Mottley@arm.com>
Co-authored-by: Jean Perier <jperier@nvidia.com>
2022-03-17 14:36:51 +01:00
Kiran Chandramohan e525245fba [Flang] Lower the transpose intrinsic
Tranpose intrinsic performs the transpose matrix operation for arrays
of rank 2. The intrinsic is lowered to a runtime call.

This is part of the upstreaming effort from the fir-dev branch in [1].
[1] https://github.com/flang-compiler/f18-llvm-project

Reviewed By: clementval

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

Co-authored-by: Valentin Clement <clementval@gmail.com>
Co-authored-by: Jean Perier <jperier@nvidia.com>
2022-03-17 13:15:11 +00:00
Kiran Chandramohan 2cdf5ef136 [Flang] Lower the trim intrinsic
The trim intrinsic removes trailing blank spaces from a string. The
intrinsic is lowered to a runtime call.

This is part of the upstreaming effort from the fir-dev branch in [1].
[1] https://github.com/flang-compiler/f18-llvm-project

Reviewed By: jeanPerier

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Valentin Clement <clementval@gmail.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
2022-03-17 12:36:56 +00:00
Kiran Chandramohan 5be0f0c83d [Flang] Lower Matmul intrinsic
The Matmul intrinsic performs matrix multiplication on rank 2 arrays.
The intrinsic is lowered to a runtime call.

This is part of the upstreaming effort from the fir-dev branch in [1].
[1] https://github.com/flang-compiler/f18-llvm-project

Reviewed By: clementval

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Valentin Clement <clementval@gmail.com>
2022-03-17 12:31:03 +00:00
Valentin Clement 51cf471dc1
[flang] Lower misc intrinsics
This patch adds lowering for couple of intrinsics:
- `btest`
- `ceiling`
- `nearest`
- `scale`

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

Reviewed By: jeanPerier

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: AlexisPerry <aperry@lanl.gov>
2022-03-17 13:21:53 +01:00
Valentin Clement 96fd54c964
[flang] Lower present intrinsic
This patch adds lowering for the `present` intrinsic.

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

Reviewed By: jeanPerier

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
2022-03-17 13:19:40 +01:00
Valentin Clement 4d323f4837
[flang] Lower exit intrinsic
This patch adds lowering for the `exit`
intrinsic.

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

Reviewed By: jeanPerier

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Josh Mottley <Josh.Mottley@arm.com>
2022-03-17 13:18:32 +01:00
Andrzej Warzynski 6321113f78 [flang][lowering] Add support for lowering of the index intrinsics
This patch adds support for lowering of the `index` intrinsics from
Fortran to the FIR dialect of MLIR.

This is part of the upstreaming effort from the `fir-dev` branch in [1].

[1] https://github.com/flang-compiler/f18-llvm-project

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Valentin Clement <clementval@gmail.com>
Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
2022-03-17 12:04:11 +00:00
Andrzej Warzynski cd18a6a5e2 [flang][nfc] Update comment in test 2022-03-17 11:54:02 +00:00
Jean Perier 3ed899cc74 [flang] handle allocatable components when creating array temps
When creating an array temporary in the array copy pass, care must be
taken with allocatable components. The element components needs to be
given a clean unallocated status before being used in the assignments.
This is because assignment of allocatable components makes deep copy,
and may cause deallocation of the previous value if it was allocated.
Hence the previous allocation status cannot be let undefined.

On top of that, when cleaning-up the temp, all allocatable components
that may have been allocated must be deallocated.

This patch implements this by centralizing the code making and cleaning
array temps in ArrayValueCopy.cpp, and by calling Initialize and Destroy
runtime entry points when they are allocatable components.

Differential Revision: https://reviews.llvm.org/D121892
2022-03-17 10:56:20 +01:00
Valentin Clement eea7c935d2
[flang] Lower array related intrinsics
This patch adds lowering for somw array related intrinsics:
- `reshape`
- `spread`

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

Reviewed By: schweitz

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: mleair <leairmark@gmail.com>
2022-03-17 07:21:44 +01:00
Valentin Clement cc38a4a665
[flang] Lower character related intrinsics
This patch adds lowering for some character related
intrinsics:
- `scan`
- `verify`

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

Reviewed By: PeteSteinfeld

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: mleair <leairmark@gmail.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
2022-03-17 07:16:08 +01:00
River Riddle 4a3460a791 [mlir:FunctionOpInterface] Rename the "type" attribute to "function_type"
This removes any potential confusion with the `getType` accessors
which correspond to SSA results of an operation, and makes it
clear what the intent is (i.e. to represent the type of the function).

Differential Revision: https://reviews.llvm.org/D121762
2022-03-16 17:07:04 -07:00
River Riddle 3655069234 [mlir] Move the Builtin FuncOp to the Func dialect
This commit moves FuncOp out of the builtin dialect, and into the Func
dialect. This move has been planned in some capacity from the moment
we made FuncOp an operation (years ago). This commit handles the
functional aspects of the move, but various aspects are left untouched
to ease migration: func::FuncOp is re-exported into mlir to reduce
the actual API churn, the assembly format still accepts the unqualified
`func`. These temporary measures will remain for a little while to
simplify migration before being removed.

Differential Revision: https://reviews.llvm.org/D121266
2022-03-16 17:07:03 -07:00
Eric Schweitz fb99266401 [flang] Remove unused code and redundant assertion.
Differential Revision: https://reviews.llvm.org/D121864
2022-03-16 16:09:35 -07:00
Emil Kieri b85922cde6 [flang] Include missing internal interfaces in .mod files
Interfaces which are internal to a procedure need to be included in
module files if (and only if) they are referenced in the interface of
the procedure. That is, they are needed if they are the interfaces of
dummy or return value procedures.

Fixes #53420

Differential Revision: https://reviews.llvm.org/D121738
2022-03-16 21:36:02 +01:00