#
27d9a479 |
| 12-Dec-2023 |
jeanPerier <jperier@nvidia.com> |
[flang] Add struct passing target rewrite hooks and partial X86-64 impl (#74829)
In the context of C/Fortran interoperability (BIND(C)), it is possible
to give the VALUE attribute to a BIND(C) deri
[flang] Add struct passing target rewrite hooks and partial X86-64 impl (#74829)
In the context of C/Fortran interoperability (BIND(C)), it is possible
to give the VALUE attribute to a BIND(C) derived type dummy, which
according to Fortran 2018 18.3.6 - 2. (4) implies that it must be passed
like the equivalent C structure value. The way C structure value are
passed is ABI dependent.
LLVM does not implement the C struct ABI passing for LLVM aggregate type
arguments. It is up to the front-end, like clang is doing, to split the
struct into registers or pass the struct on the stack (llvm "byval") as
required by the target ABI.
So the logic for C struct passing sits in clang. Using it from flang
requires setting up a lot of clang context and to bridge FIR/MLIR
representation to clang AST representation for function signatures (in
both directions). It is a non trivial task.
See
https://stackoverflow.com/questions/39438033/passing-structs-by-value-in-llvm-ir/75002581#75002581.
Since BIND(C) struct are rather limited as opposed to generic C struct
(e.g. no bit fields). It is easier to provide a limited implementation
of it for the case that matter to Fortran.
This patch:
- Updates the generic target rewrite pass to keep track of both the new
argument type and attributes. The motivation for this is to be able to
tell if a previously marshalled argument is passed in memory (it is a C
pointer), or if it is being passed on the stack (has the byval llvm
attributes).
- Adds an entry point in the target specific codegen to marshal struct
arguments, and use it in the generic target rewrite pass.
- Implements limited support for the X86-64 case. So far, the support
allows telling if a struct must be passed in register or on the stack,
and to deal with the stack case. The register case is left TODO in this
patch.
The X86-64 ABI implemented is the System V ABI for AMD64 version 1.0
show more ...
|
#
f65e3af7 |
| 04-Dec-2023 |
jeanPerier <jperier@nvidia.com> |
[flang] Implement COMPLEX(10) passing and return ABI for X86-64 linux (#74094)
COMPLEX(10) passing by value and returning follows C complex
passing/returning ABI.
Cover the COMPLEX(10) case (X87
[flang] Implement COMPLEX(10) passing and return ABI for X86-64 linux (#74094)
COMPLEX(10) passing by value and returning follows C complex
passing/returning ABI.
Cover the COMPLEX(10) case (X87 / __Complex long double on X86-64).
Implements System V ABI for AMD64 version 1.0.
The LLVM signatures match the one generated by clang for the __Complex
long double case.
Note that a FIXME is added for the COMPLEX(8) case that is incorrect in
a corner case. This will be fixed when dealing with passing derived type
by value in BIND(C) context.
show more ...
|
#
04b18530 |
| 29-Nov-2023 |
Pete Steinfeld <47540744+psteinfeld@users.noreply.github.com> |
[flang] Cleanup of NYI messages (#73740)
This update makes the user visible messages relating to features that
are not yet implemented be more consistent. I also cleaned up some of
the code.
Fo
[flang] Cleanup of NYI messages (#73740)
This update makes the user visible messages relating to features that
are not yet implemented be more consistent. I also cleaned up some of
the code.
For NYI messages that refer to intrinsics, I made sure the the message
begins with "not yet implemented: intrinsic:" to make them easier to
recognize.
I created some utility functions for NYI reporting that I put into
.../include/Optimizer/Support/Utils.h. These mainly convert MLIR types
to their Fortran equivalents.
I converted the NYI code to use the newly created utility functions.
show more ...
|
Revision tags: llvmorg-17.0.6 |
|
#
be9fa9de |
| 16-Nov-2023 |
Fabian Mora <fmora.dev@gmail.com> |
[flang][NVPTX] Add initial support to the NVPTX target (#71992)
This patch adds initial support to the NVPTX target, enabling `flang` to
produce OpenMP offload code for NVPTX targets.
|
Revision tags: llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init, llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2 |
|
#
774703ec |
| 17-Apr-2023 |
Markus Mützel <markus.muetzel@gmx.de> |
[flang] Complex numbers in function arguments on Windows
Function arguments or return values that are complex floating point values aren't correctly lowered for Windows x86 32-bit and 64-bit targets
[flang] Complex numbers in function arguments on Windows
Function arguments or return values that are complex floating point values aren't correctly lowered for Windows x86 32-bit and 64-bit targets. See: https://github.com/llvm/llvm-project/issues/61976
Add targets that are specific for these platforms and OS.
With thanks to @mstorsjo for pointing out the fix.
Reviewed By: vzakhari
Differential Revision: https://reviews.llvm.org/D147768
show more ...
|
#
30408f5c |
| 11-Apr-2023 |
Valentin Clement <clementval@gmail.com> |
[flang][NFC] Move TypeConverter.h header file to include dir
After the extraction of the TypeConverter, move the header files to the include dir so the shared library build is fine.
Reviewed By: Pe
[flang][NFC] Move TypeConverter.h header file to include dir
After the extraction of the TypeConverter, move the header files to the include dir so the shared library build is fine.
Reviewed By: PeteSteinfeld
Differential Revision: https://reviews.llvm.org/D147979
show more ...
|
Revision tags: llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4 |
|
#
b07ef9e7 |
| 09-Mar-2023 |
Renaud-K <rkauffmann@nvidia.com> |
Break circular dependency between FIR dialect and utilities
|
Revision tags: llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2 |
|
#
720f728d |
| 08-Feb-2023 |
Weining Lu <luweining@loongson.cn> |
[flang] Add LoongArch64 support to lib/Optimizer/CodeGen/Target.cpp
Add LoongArch64 linux target specifics to Target.cpp which is similar to RISCV-64 in D136547.
For LoongArch, a complex floating-p
[flang] Add LoongArch64 support to lib/Optimizer/CodeGen/Target.cpp
Add LoongArch64 linux target specifics to Target.cpp which is similar to RISCV-64 in D136547.
For LoongArch, a complex floating-point number, or a structure containing just one complex floating-point number, is passed as though it were a structure containing two floating-point reals.
Reviewed By: vzakhari
Differential Revision: https://reviews.llvm.org/D143131
show more ...
|
#
08749a91 |
| 01-Feb-2023 |
Jan Sjodin <jan_sjodin@yahoo.com> |
[flang] Add AMDGPU target in flang
This is the first patch of several that will enable generating code for AMD GPUs. It adds the AMDGPU target so it can be used with the --target and -mcpu options.
[flang] Add AMDGPU target in flang
This is the first patch of several that will enable generating code for AMD GPUs. It adds the AMDGPU target so it can be used with the --target and -mcpu options.
Reviewed By: kiranchandramohan
Differential Revision: https://reviews.llvm.org/D143102
show more ...
|
Revision tags: llvmorg-16.0.0-rc1 |
|
#
ff794116 |
| 28-Jan-2023 |
Slava Zakharin <szakharin@nvidia.com> |
[flang] Use proper attributes for runtime calls with 'i1' arguments/returns.
Clang uses signext/zeroext attributes for integer arguments shorter than the default 'int' type on a target. So Flang has
[flang] Use proper attributes for runtime calls with 'i1' arguments/returns.
Clang uses signext/zeroext attributes for integer arguments shorter than the default 'int' type on a target. So Flang has to match this for functions from Fortran runtime and also for BIND(C) routines. This patch implements ABI adjustments only for Fortran runtime calls. BIND(C) part will be done separately.
This resolves https://github.com/llvm/llvm-project/issues/58579
Differential Revision: https://reviews.llvm.org/D142677
show more ...
|
Revision tags: llvmorg-17-init, llvmorg-15.0.7 |
|
#
320fbff4 |
| 30-Dec-2022 |
Mark Danial <mark.danial@ibm.com> |
[Flang] Add ppc64 support to Optimizer/CodeGen/Target.cpp for AIX 64 bit
Adding support for ppc64 (big endian) in order to support flang on 64 bit AIX
Reviewed By: clementval, kiranchandramohan
Di
[Flang] Add ppc64 support to Optimizer/CodeGen/Target.cpp for AIX 64 bit
Adding support for ppc64 (big endian) in order to support flang on 64 bit AIX
Reviewed By: clementval, kiranchandramohan
Differential Revision: https://reviews.llvm.org/D138390
show more ...
|
#
68755f22 |
| 01-Dec-2022 |
Slava Zakharin <szakharin@nvidia.com> |
Revert "[flang] Use proper attributes for runtime calls with 'i1' arguments/returns."
This reverts commit d5b0de35bdd9a3f4d4a093e7938b06add34678eb.
|
Revision tags: llvmorg-15.0.6 |
|
#
d5b0de35 |
| 18-Nov-2022 |
Slava Zakharin <szakharin@nvidia.com> |
[flang] Use proper attributes for runtime calls with 'i1' arguments/returns.
Clang uses signext/zeroext attributes for integer arguments shorter than the default 'int' type on a target. So Flang has
[flang] Use proper attributes for runtime calls with 'i1' arguments/returns.
Clang uses signext/zeroext attributes for integer arguments shorter than the default 'int' type on a target. So Flang has to match this for functions from Fortran runtime and also for BIND(C) routines. This patch implements ABI adjustments only for Fortran runtime calls. BIND(C) part will be done separately.
This resolves https://github.com/llvm/llvm-project/issues/58579
Differential Revision: https://reviews.llvm.org/D137050
show more ...
|
Revision tags: llvmorg-15.0.5, llvmorg-15.0.4 |
|
#
bac88e89 |
| 23-Oct-2022 |
Qihan Cai <qcai8733@uni.sydney.edu.au> |
[flang] Add RISCV-64 support to Optimizer/CodeGen/Target.cpp
As an attempt to fix errors in Flang regression tests on RISCV64 platform, RISCV64 target was added, and subsequent tests were provided.
[flang] Add RISCV-64 support to Optimizer/CodeGen/Target.cpp
As an attempt to fix errors in Flang regression tests on RISCV64 platform, RISCV64 target was added, and subsequent tests were provided.
Reviewed By: vzakhari
Differential Revision: https://reviews.llvm.org/D136547
show more ...
|
#
1dd5ca24 |
| 19-Nov-2022 |
Slava Zakharin <szakharin@nvidia.com> |
Revert "[flang] Use proper attributes for runtime calls with 'i1' arguments/returns."
Buildbot might be failing because of this: https://lab.llvm.org/buildbot/#/builders/65/builds/7283
This reverts
Revert "[flang] Use proper attributes for runtime calls with 'i1' arguments/returns."
Buildbot might be failing because of this: https://lab.llvm.org/buildbot/#/builders/65/builds/7283
This reverts commit 396ead93e3cead59727947afdea1fc2b49f0fc34.
show more ...
|
#
396ead93 |
| 18-Nov-2022 |
Slava Zakharin <szakharin@nvidia.com> |
[flang] Use proper attributes for runtime calls with 'i1' arguments/returns.
Clang uses signext/zeroext attributes for integer arguments shorter than the default 'int' type on a target. So Flang has
[flang] Use proper attributes for runtime calls with 'i1' arguments/returns.
Clang uses signext/zeroext attributes for integer arguments shorter than the default 'int' type on a target. So Flang has to match this for functions from Fortran runtime and also for BIND(C) routines. This patch implements ABI adjustments only for Fortran runtime calls. BIND(C) part will be done separately.
This resolves https://github.com/llvm/llvm-project/issues/58579
Differential Revision: https://reviews.llvm.org/D137050
show more ...
|
#
6951cec6 |
| 25-Oct-2022 |
Fangrui Song <i@maskray.me> |
[flang] Allow all OSes in fir::CodeGenSpecifics::get
This allows all ELF operating systems to use target specifics tuned for Linux, since they use mostly the same ABIs. If some triples are to exclud
[flang] Allow all OSes in fir::CodeGenSpecifics::get
This allows all ELF operating systems to use target specifics tuned for Linux, since they use mostly the same ABIs. If some triples are to excluded, it's better done at the driver layer.
Reviewed By: emaste
Differential Revision: https://reviews.llvm.org/D135100
show more ...
|
Revision tags: llvmorg-15.0.3, working, llvmorg-15.0.2 |
|
#
1774a8a7 |
| 03-Oct-2022 |
Rainer Orth <ro@gcc.gnu.org> |
[flang] Add Sparc support to Optimizer/CodeGen/Target.cpp
As described in Issue #57642, `flang` currently lacks SPARC support in `Optimizer/CodeGen/Target.cpp`, which causes a considerable number of
[flang] Add Sparc support to Optimizer/CodeGen/Target.cpp
As described in Issue #57642, `flang` currently lacks SPARC support in `Optimizer/CodeGen/Target.cpp`, which causes a considerable number of tests to `FAIL` with
error: flang/lib/Optimizer/CodeGen/Target.cpp:310: not yet implemented: target not implemented
This patch fixes this by following GCC`s documentation of the ABI described in the Issue.
Tested on `sparcv9-sun-solaris2.11`.
Differential Revision: https://reviews.llvm.org/D133561
show more ...
|
Revision tags: llvmorg-15.0.1, llvmorg-15.0.0, llvmorg-15.0.0-rc3 |
|
#
bcb2740f |
| 17-Aug-2022 |
Rainer Orth <ro@gcc.gnu.org> |
[flang] Add Solaris/x86 support to Optimizer/CodeGen/Target.cpp
When testing LLVM 15.0.0 rc1 on Solaris, I found that 50+ flang tests `FAIL`ed with
error: /vol/llvm/src/llvm-project/local/flang/l
[flang] Add Solaris/x86 support to Optimizer/CodeGen/Target.cpp
When testing LLVM 15.0.0 rc1 on Solaris, I found that 50+ flang tests `FAIL`ed with
error: /vol/llvm/src/llvm-project/local/flang/lib/Optimizer/CodeGen/Target.cpp:310: not yet implemented: target not implemented
This patch fixes that for Solaris/x86, where the fix is trivial (just handling it like the other x86 OSes).
Tested on `amd64-pc-solaris2.11`; only a single failure remains now.
Differential Revision: https://reviews.llvm.org/D131054
show more ...
|
Revision tags: llvmorg-15.0.0-rc2, llvmorg-15.0.0-rc1, llvmorg-16-init, llvmorg-14.0.6 |
|
#
1906188f |
| 22-Jun-2022 |
Valentin Clement <clementval@gmail.com> |
[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/
[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>
show more ...
|
#
0c1cf585 |
| 13-Jun-2022 |
Eric Schweitz <eschweitz@nvidia.com> |
[flang][NFC] Add source location information to report unsupported complex types
This patch is part of the upstreaming effort from fir-dev branch.
Reviewed By: jeanPerier, PeteSteinfeld
Differenti
[flang][NFC] Add source location information to report unsupported complex types
This patch is part of the upstreaming effort from fir-dev branch.
Reviewed By: jeanPerier, PeteSteinfeld
Differential Revision: https://reviews.llvm.org/D127634
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
show more ...
|
Revision tags: llvmorg-14.0.5, llvmorg-14.0.4 |
|
#
e601b2a1 |
| 15-May-2022 |
Andrzej Warzynski <andrzej.warzynski@arm.com> |
[flang][driver] Add support for generating executables on MacOSX/Darwin
This patch basically extends https://reviews.llvm.org/D122008 with support for MacOSX/Darwin.
To facilitate this, I've added
[flang][driver] Add support for generating executables on MacOSX/Darwin
This patch basically extends https://reviews.llvm.org/D122008 with support for MacOSX/Darwin.
To facilitate this, I've added `MacOSX` to the list of supported OSes in Target.cpp. Flang already supports `Darwin` and it doesn't really do anything OS-specific there (it could probably safely skip checking the OS for now).
Note that generating executables remains hidden behind the `-flang-experimental-exec` flag. Also, we don't need to add `-lm` on MacOSX as `libm` is effectively included in `libSystem` (which is linked in unconditionally).
Differential Revision: https://reviews.llvm.org/D125628
show more ...
|
Revision tags: llvmorg-14.0.3, llvmorg-14.0.2, llvmorg-14.0.1, llvmorg-14.0.0, llvmorg-14.0.0-rc4, llvmorg-14.0.0-rc3, llvmorg-14.0.0-rc2 |
|
#
b389fbd0 |
| 09-Feb-2022 |
Andrzej Warzynski <andrzej.warzynski@arm.com> |
[flang] Add Win32 to the list of supported triples
This patch adds Win32 to the list of supported triples in `fir::CodeGenSpecifics`. This change means that we can use the "native" triple, even when
[flang] Add Win32 to the list of supported triples
This patch adds Win32 to the list of supported triples in `fir::CodeGenSpecifics`. This change means that we can use the "native" triple, even when running tests on Windows. Currently this affects only 1 test, but it will change once we start adding more tests for lowering and code-generation.
Differential Revision: https://reviews.llvm.org/D119332
show more ...
|
Revision tags: llvmorg-14.0.0-rc1, llvmorg-15-init, llvmorg-13.0.1, llvmorg-13.0.1-rc3, llvmorg-13.0.1-rc2, llvmorg-13.0.1-rc1 |
|
#
faf869dc |
| 11-Nov-2021 |
Diana Picus <diana.picus@linaro.org> |
[Flang] Fixup some comments. NFC
Clarify some comments as discussed here: https://github.com/flang-compiler/f18-llvm-project/pull/1210
|
#
bb201826 |
| 10-Nov-2021 |
Andrzej Warzynski <andrzej.warzynski@arm.com> |
[flang][codegen] Add type conversion for `fir.boxchar`
This is part of the upstreaming effort from the `fir-dev` branch in [1].
[1] https://github.com/flang-compiler/f18-llvm-project
Differential
[flang][codegen] Add type conversion for `fir.boxchar`
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/D113571
Patch originally written by: Co-authored-by: Eric Schweitz <eschweitz@nvidia.com> Co-authored-by: Jean Perier <jperier@nvidia.com>
show more ...
|