Commit Graph

4160 Commits

Author SHA1 Message Date
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
Valentin Clement
65cb2e1ed1
[flang] Lower pack|unpack intrinsics
This patch adds lowering for the `pack` and `unpack`
intrinsics.

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

Reviewed By: schweitz

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

Co-authored-by: Peter Steinfeld <psteinfeld@nvidia.com>
Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: mleair <leairmark@gmail.com>
Co-authored-by: Kiran Chandramohan <kiran.chandramohan@arm.com>
2022-03-16 21:12:46 +01:00
Valentin Clement
69b3303e6b
[flang] Lower numeric related instrinsics
This patch adds lowering for some numeric related
intrinsics:
- `exponent`
- `floor`
- `fraction`
- `mod`
- `modulo`
- `nint`
- `not`
- `product`

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

Reviewed By: PeteSteinfeld, schweitz

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

Co-authored-by: Peter Steinfeld <psteinfeld@nvidia.com>
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-16 20:43:07 +01:00
Valentin Clement
8d161c1f80
[flang] Exclude IO test for windows
This test is platform specific. It makes the windows
buildbot fails https://lab.llvm.org/buildbot/#/builders/172/builds/9708
2022-03-16 20:33:50 +01:00
Valentin Clement
24f3d55a5a
[flang] Keep ifdef macro for INT128
This was wrongly removed in 9aeb7f035b
and makes buildbot fail.
2022-03-16 19:11:01 +01:00
Andrzej Warzynski
11a12544b5 [flang][lowering] Add support for lowering of the i{a}char intrinsics
This patch adds support for lowering of the `i{a}char` 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/D121790

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: zacharyselk <zrselk@gmail.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
2022-03-16 17:15:39 +00:00
Andrzej Warzynski
365fcecda7 [flang][lowering] Add support for lowering of the ibclr intrinsic
This patch adds support for lowering of the `ibclr` 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

Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Valentin Clement <clementval@gmail.com>

Differential Revision: https://reviews.llvm.org/D121789
2022-03-16 17:05:01 +00:00
Andrzej Warzynski
3887ebbba0 [flang][lowering] Add support for lowering of the ieor intrinsic
This patch adds support for lowering of the `ieor` 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

Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Valentin Clement <clementval@gmail.com>

Differential Revision: https://reviews.llvm.org/D121791
2022-03-16 16:50:43 +00:00
Andrzej Warzynski
6f0041ea44 [flang][lowering] Add lowering for the size intrinsic
This patch adds support for lowering of the `size` 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/D121803

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-16 16:30:12 +00:00
Valentin Clement
4840e7505d
[flang] Lower shift intrinsics
This patch adds lowering for shift intrinsics:
- `ishft`
- `eoshift`
- `ishftc`
- `cshift`

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

Reviewed By: PeteSteinfeld

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

Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Peter Steinfeld <psteinfeld@nvidia.com>
Co-authored-by: AlexisPerry <aperry@lanl.gov>
2022-03-16 17:16:46 +01:00
Valentin Clement
9aeb7f035b
[flang] Lower IO input with vector subscripts
This patch adds lowering for IO input with vector subscripts.
It defines a VectorSubscriptBox class that allow representing and working
with a lowered Designator containing vector subscripts while ensuring
all the subscripts expression are only lowered once.

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

Reviewed By: PeteSteinfeld

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
2022-03-16 17:13:23 +01:00
Andrzej Warzynski
3833b4b4d7 [flang][lowering] Add lowering for the set_exponent intrinsic
This patch adds support for lowering of the `set_exponent` 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/D121805

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eun Jung Park <ejpark@lanl.gov>
2022-03-16 15:16:10 +00:00
Jean Perier
7d52beb275 [flang] Relax fir.rebox verifier with characters
Allow fir.rebox input and output element type to differ for characters
if:
- Any of the character type is dynamic. Fortran allows making pointer
assignments between deferred and constant lengths entities, making this
case useful (if the input length is dynamic and the output length constant,
it is a user requirement that the length matches at runtime. There is no
option to check this at runtime, but it could be added as an option to
fir.rebox codegen later if desired).

- Or, there is a slice in the fir.rebox (the fir.rebox can implement a
substring view, hence the constant output and input lengths).

This is only a verifier constraint change, the fir.rebox codegen is not
impacted and already support those cases.

Add related FIR parsing, error, and codegen tests.

Differential Revision: https://reviews.llvm.org/D121710
2022-03-16 16:08:52 +01:00
Valentin Clement
6ed9d3a255
[flang] Lower count intrinsic
This patch adds lowering for the count intrinsic.

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

Reviewed By: jeanPerier

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: mleair <leairmark@gmail.com>
2022-03-16 14:41:03 +01:00
Andrzej Warzynski
a7c08bcf77 [flang][driver] Add support for -mllvm
This option is added in both `flang-new` (the compiler driver) and
`flang-new -fc1` (the frontend driver). The semantics are consistent
with `clang` and `clang -cc1`.

As Flang does not run any LLVM passes when invoked with `-emit-llvm`
(i.e. `flang-new -S -emit-llvm <file>`), the tests use
`-S`/`-c`/`-emit-obj` instead. These options require an LLVM backend to
be run by the driver to generate the output (this makese `-mllvm`
relevant here).

Differential Revision: https://reviews.llvm.org/D121374
2022-03-16 10:41:04 +00:00
Valentin Clement
10766b75ce
[flang] Lower adjustl and adjustr intrinsics
This patch adds lowering for the `adjustl` and `adjustr`
intrinsics.

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

Reviewed By: jeanPerier

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

Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
Co-authored-by: Jean Perier <jperier@nvidia.com>
2022-03-16 11:35:28 +01:00
Valentin Clement
a16eddb2b4
[flang] Lower transfer instrinsic
This patch adds lowering for the `transfer` intrinsic.
The calls are lowered to runtime function calls.

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

Reviewed By: jeanPerier

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: mleair <leairmark@gmail.com>
2022-03-16 11:33:50 +01:00
Andrzej Warzynski
63bbac1065 [flang][lowering] Add support for lowering of the ibset intrinsic
This patch adds support for lowering of the `ibset` 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

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Valentin Clement <clementval@gmail.com>
Co-authored-by: V Donaldson <vdonaldson@nvidia.com>

Differential Revision: https://reviews.llvm.org/D121717
2022-03-16 10:33:19 +00:00
Sam McCall
75acad41bc Use lit_config.substitute instead of foo % lit_config.params everywhere
This mechanically applies the same changes from D121427 everywhere.

Differential Revision: https://reviews.llvm.org/D121746
2022-03-16 09:57:41 +01:00
Valentin Clement
264d966232
[flang] Lower system_clock intrinsic
This patch adds lowering ofr the `system_clock` intrinsic.
The call is lowered to runtime function call.

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

Reviewed By: jeanPerier

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

Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
Co-authored-by: Jean Perier <jperier@nvidia.com>
2022-03-16 09:51:51 +01:00
Valentin Clement
9daf576583
[flang] Lower date_and_time and cpu_time intrinsics
This patch lowers the `cpu_time` and the `date_and_time` instrinsics to
FIR and runtime calls.

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

Depends on D121704

Reviewed By: PeteSteinfeld

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

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-03-16 06:38:26 +01:00
Valentin Clement
a75b949320
[flang][NFC] Remove duplicated header file
Remove IntervalSet.h since it is a duplicate from
flang/include/flang/Lower/IntervalSet.h.

Reviewed By: PeteSteinfeld

Differential Revision: https://reviews.llvm.org/D121747
2022-03-16 06:36:41 +01:00
Valentin Clement
7783de7fe3
[flang] Move null entry at the correct place
This is a fix for failing buildbot
https://lab.llvm.org/buildbot/#/builders/172/builds/9652
2022-03-15 22:56:48 +01:00
Valentin Clement
c3ba885dd7
[flang] Fix intrinsic entry 2022-03-15 22:40:11 +01:00
Valentin Clement
a1918fdf08
[flang] Lower random_[init|number|seed] intrinsics
Thsi patch add the infrastructure to lower the random related
intrinsics:

- `random_init`
- `random_number`
- `random_seed`

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

Reviewed By: PeteSteinfeld, schweitz

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

Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
Co-authored-by: Jean Perier <jperier@nvidia.com>
2022-03-15 22:31:56 +01:00
Valentin Clement
94a1106357
[flang] Lower min|max intrinsics
This patch adds lowering for the following intrinsics:
- `max`
- `maxloc`
- `maxval`
- `minloc`
- `minval`

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

Reviewed By: PeteSteinfeld

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: mleair <leairmark@gmail.com>
2022-03-15 22:24:10 +01:00
Valentin Clement
2696901162
[flang] Lower character related intrinsic
This patch adds lowering for the following character related intrinsics:
- `len`
- `len_trim`
- `lge`, `lgt`, `lle` and `llt`

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

Reviewed By: PeteSteinfeld

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

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-03-15 22:16:47 +01:00
Valentin Clement
3240a34dbc
[flang] Lower allocated intrinsic
This patch adds lowering for the `allocated`
intrinsic.

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

Reviewed By: jeanPerier, PeteSteinfeld

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
2022-03-15 22:13:07 +01:00
Valentin Clement
8b50353335
[flang] Lower alternate return
This patch adds the lowering infrastructure for the lowering of
alternat returns.

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

Depends on D121698

Reviewed By: PeteSteinfeld

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

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-03-15 22:04:13 +01:00
Valentin Clement
76134f4138
[flang] Lower entry statement
This patch add the lowering for the entry statement.

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

Depends on D121697

Reviewed By: PeteSteinfeld

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

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-03-15 22:02:41 +01:00
Valentin Clement
a1425019e7
[flang] Lower more pointer assignments/disassociation cases
This patch lowers more cases of pointer assignments and
disassociations.

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

Reviewed By: PeteSteinfeld, schweitz

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

Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
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-15 21:58:33 +01:00
Andrzej Warzynski
be6e84e252 [flang][lowering] Add support for lowering of the ibits intrinsic
This patch adds support for lowering of the `ibits` 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/D121693

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Valentin Clement <clementval@gmail.com>
Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
2022-03-15 16:33:13 +00:00
Andrzej Warzynski
a6ec1e3d79 [flang][lowering] Add support for lowering the dim intrinsic
This patch adds support for lowering of the `dim` 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/D121689

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: Valentin Clement <clementval@gmail.com>
Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
2022-03-15 16:27:45 +00:00
Andrzej Warzynski
6714da0d14 [flang][lowering] Add support for lowering the dot_product intrinsic
This patch adds support for lowering the `dot_product` 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/D121684

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: Valentin Clement <clementval@gmail.com>
Co-authored-by: Mark Leair <leairmark@gmail.com>
2022-03-15 15:59:27 +00:00
Jean Perier
83b0d0f964 [flang] fulfill -Msave/-fno-automatic in main programs too
`semantics::IsSaved()` was not applying -Msave/-fno-automatic for main programs.
This caused issues since lowering relies on it to allocate static
variables. This did not match nvfortran/gfortran behaviors where
-fno-automatic/-Msave control the static allocation of scalars in
main programs.

Some program may rely on main program scalars to be statically allocated in
bss (and therefore initialized to zero) with -Msave/-fno-automatic
flags.

Differential Revision: https://reviews.llvm.org/D121603
2022-03-15 09:33:07 +01:00
Jean Perier
a69cb78242 [flang] Hanlde COMPLEX 2/3/10 in runtime TypeCode(cat, kind)
Type codes for COMPLEX kinds 2, 3, and 10 were added in https://reviews.llvm.org/D117336
but handling for these kinds in TypeCode(cat, kind) has not been added
yet.

Differential Revision: https://reviews.llvm.org/D121587
2022-03-15 09:26:14 +01:00
River Riddle
bbfec2a1b0 [mlir] Remove the deprecated ODS Op verifier/parser/printer code blocks
These have been deprecated for ~1 month now and can be removed.

Differential Revision: https://reviews.llvm.org/D121090
2022-03-15 01:17:30 -07:00
River Riddle
23e3cbe24a [mlir] Refactor how parser/printers are specified for AttrDef/TypeDef
There is currently an awkwardly complex set of rules for how a
parser/printer is generated for AttrDef/TypeDef. It can change depending on if a
mnemonic was specified, if there are parameters, if using the assemblyFormat, if
individual parser/printer code blocks were specified, etc. This commit refactors
this to make what the attribute/type wants more explicit, and to better align
with how formats are specified for operations.

Firstly, the parser/printer code blocks are removed in favor of a
`hasCustomAssemblyFormat` bit field. This aligns with the operation format
specification (and is nice to remove code blocks from ODS).

This commit also adds a requirement to explicitly set `assemblyFormat` or
`hasCustomAssemblyFormat` when the mnemonic is set and the attr/type
has no parameters. This removes the weird implicit matrix of behavior,
and also encourages the author to make a conscious choice of either C++
or declarative format instead of implicitly opting them into the C++
format (we should be pushing towards declarative when possible).

Differential Revision: https://reviews.llvm.org/D121505
2022-03-15 00:42:31 -07:00