13 Commits

Author SHA1 Message Date
Valentin Clement (バレンタイン クレメン)
12ba74e181
[flang] Do not produce result for void runtime call (#123155)
Runtime function call to a void function are producing a ssa value
because the FunctionType result is set to NoneType with is later
translated to a empty struct. This is not an issue when going to LLVM IR
but it breaks when lowering a gpu module to PTX. This patch update the
RTModel to correctly set the FunctionType result type to nothing.

This is one runtime call before this patch at the LLVM IR dialect step.
```
%45 = llvm.call @_FortranAAssign(%arg0, %1, %44, %4) : (!llvm.ptr, !llvm.ptr, !llvm.ptr, i32) -> !llvm.struct<()>
```

After the patch the call would be correctly formed
```
llvm.call @_FortranAAssign(%arg0, %1, %44, %4) : (!llvm.ptr, !llvm.ptr, !llvm.ptr, i32) -> ()
```

Without the patch it would lead to error like:
```
ptxas /tmp/mlir-cuda_device_mod-nvptx64-nvidia-cuda-sm_60-e804b6.ptx, line 10; error   : Output parameter cannot be an incomplete array.
ptxas /tmp/mlir-cuda_device_mod-nvptx64-nvidia-cuda-sm_60-e804b6.ptx, line 125; error   : Call has wrong number of parameters
```

The change is pretty much mechanical.
2025-01-16 12:34:38 -08:00
Tarun Prabhu
7ca4012e11
[flang][docs] Fix broken flang website (#80363)
These are several fixes for the flang site. The look has been changed to
match clang since flang, like clang, is a frontend. Some broken links
were removed. Most fixes are to secton titles so the table of contents
is generated correctly. A minor typo has been fixed.
2024-02-02 12:18:11 -07:00
Corentin Jabot
c226d6c88f [Documentation][NFC] Remove invalid language specifiers in markdown code blocks 2023-10-07 16:05:56 +02:00
Valentin Clement
9b907001ab
[flang][NFC] Update polymorphic design document to reflect implementation
Update the design document to reflect the actual implementation
of polymorphic entities.

Reviewed By: jeanPerier, PeteSteinfeld

Differential Revision: https://reviews.llvm.org/D147665
2023-04-06 08:43:07 -07:00
Valentin Clement
019bec8c8a
[flang][NFC] Remove implemented TODOs 2022-12-05 10:32:08 +01:00
Valentin Clement
147fe9de29
[flang][NFC] Update TODOs list 2022-11-21 10:05:18 +01:00
Valentin Clement
f2bd7acacd
[flang][NFC] Update document with current status
fir.dispatch codegen was done in D136189.
2022-10-31 09:45:47 +01:00
Valentin Clement
6c3c81b983
[flang] Lower and code gen for allocate on polymorphic entities
When allocating a polymorphic entity, its type descriptor can come
from the declared type or can be provided in the allocate statement.
This patch adds lowering for allocate on polymorphic by calling
the `AllocatableInitDerived` runtime function with the correct
type descriptor. Some adaptation are made in the code generation
to accept fir.class where it is appropriate.

Reviewed By: jeanPerier

Differential Revision: https://reviews.llvm.org/D136426
2022-10-21 14:34:03 +02:00
Valentin Clement
640946e192
[flang][NFC] Update fir.dispatch format in doc 2022-10-07 09:24:50 +02:00
Valentin Clement
3eef2c2b13
[flang] Lower TYPE(*) as fir.box<none>
This patch lowers `TYPE(*)` correctly to fir.box<none>.

Reviewed By: jeanPerier

Differential Revision: https://reviews.llvm.org/D135141
2022-10-04 21:30:09 +02:00
Valentin Clement
262c23d2ca
[flang] Introduce fir.class type
Introduce a new ClassType for polymorphic
entities. A fir.class type is similar to a fir.box type in
many ways and is also base on the BaseBoxType.

This patch is part of the implementation of the poltymorphic
entities.
https://github.com/llvm/llvm-project/blob/main/flang/docs/PolymorphicEntities.md

Depends on D134956

Reviewed By: jeanPerier

Differential Revision: https://reviews.llvm.org/D134957
2022-10-02 20:13:51 +02:00
Valentin Clement
458598ccc5
[flang][NFC] Remove not polymorphic from assumed type 2022-09-19 09:51:11 +02:00
Valentin Clement
26d3655a15
[flang][docs] Add lowering design doc for polymorphic entities
This document aims to give insights at the representation of polymorphic
entities in FIR and how polymorphic related constructs and features are lowered
to FIR.

Reviewed By: klausler, razvanlupusoru

Differential Revision: https://reviews.llvm.org/D131515
2022-08-15 18:13:15 +02:00