Revision tags: llvmorg-21-init, llvmorg-19.1.7 |
|
#
fc97d2e6 |
| 18-Dec-2024 |
Peter Klausler <pklausler@nvidia.com> |
[flang] Add UNSIGNED (#113504)
Implement the UNSIGNED extension type and operations under control of a
language feature flag (-funsigned).
This is nearly identical to the UNSIGNED feature that h
[flang] Add UNSIGNED (#113504)
Implement the UNSIGNED extension type and operations under control of a
language feature flag (-funsigned).
This is nearly identical to the UNSIGNED feature that has been available
in Sun Fortran for years, and now implemented in GNU Fortran for
gfortran 15, and proposed for ISO standardization in J3/24-116.txt.
See the new documentation for details; but in short, this is C's
unsigned type, with guaranteed modular arithmetic for +, -, and *, and
the related transformational intrinsic functions SUM & al.
show more ...
|
Revision tags: llvmorg-19.1.6 |
|
#
2d57333d |
| 03-Dec-2024 |
Peter Klausler <pklausler@nvidia.com> |
[flang] Fix crash in HLFIR generation (#118399)
Structure constructors with multiple components would crash when
components were from parent types. The search for the right parent
component must b
[flang] Fix crash in HLFIR generation (#118399)
Structure constructors with multiple components would crash when
components were from parent types. The search for the right parent
component must be done anew for each component.
Fixes https://github.com/llvm/llvm-project/issues/118270,
https://github.com/llvm/llvm-project/issues/96994, and
https://github.com/llvm/llvm-project/issues/105848.
show more ...
|
Revision tags: llvmorg-19.1.5, llvmorg-19.1.4, llvmorg-19.1.3 |
|
#
e6a4346b |
| 18-Oct-2024 |
Scott Manley <rscottmanley@gmail.com> |
[flang] add getElementType() to fir::SquenceType and fir::VectorType (#112770)
getElementType() was missing from Sequence and Vector types. Did a
replace of the obvious places getEleTy() was used f
[flang] add getElementType() to fir::SquenceType and fir::VectorType (#112770)
getElementType() was missing from Sequence and Vector types. Did a
replace of the obvious places getEleTy() was used for these two types
and updated to use this name instead.
Co-authored-by: Scott Manley <scmanley@nvidia.com>
show more ...
|
Revision tags: llvmorg-19.1.2 |
|
#
c4204c0b |
| 03-Oct-2024 |
jeanPerier <jperier@nvidia.com> |
[flang] replace fir.complex usages with mlir complex (#110850)
Core patch of
https://discourse.llvm.org/t/rfc-flang-replace-usages-of-fir-complex-by-mlir-complex-type/82292.
After that, the last s
[flang] replace fir.complex usages with mlir complex (#110850)
Core patch of
https://discourse.llvm.org/t/rfc-flang-replace-usages-of-fir-complex-by-mlir-complex-type/82292.
After that, the last step is to remove fir.complex from FIR types.
show more ...
|
#
b91a25ef |
| 03-Oct-2024 |
Yusuke MINATO <minato.yusuke@fujitsu.com> |
[flang] add nsw to operations in subscripts (#110060)
This patch adds nsw to operations when lowering subscripts.
See also the discussion in the following discourse post.
https://discourse.llvm.
[flang] add nsw to operations in subscripts (#110060)
This patch adds nsw to operations when lowering subscripts.
See also the discussion in the following discourse post.
https://discourse.llvm.org/t/rfc-add-nsw-flags-to-arithmetic-integer-operations-using-the-option-fno-wrapv/77584/9
show more ...
|
Revision tags: llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init |
|
#
77d8cfb3 |
| 17-Jun-2024 |
Alexander Shaposhnikov <6532716+alexander-shaposhnikov@users.noreply.github.com> |
[Flang] Switch to common::visit more call sites (#90018)
Switch to common::visit more call sites.
Test plan: ninja check-all
|
Revision tags: llvmorg-18.1.8, llvmorg-18.1.7 |
|
#
f917c396 |
| 31-May-2024 |
jeanPerier <jperier@nvidia.com> |
[flang] improve and rename Entity::hasNonDefaultLowerBounds (#93848)
Improve hasNonDefaultLowerBounds to follow box fir.convert. This helps
HLFIR helpers to generate less code when it can be easily
[flang] improve and rename Entity::hasNonDefaultLowerBounds (#93848)
Improve hasNonDefaultLowerBounds to follow box fir.convert. This helps
HLFIR helpers to generate less code when it can be easily deduced that
the fir.box lower bounds were set to ones.
It will help me for SELECT RANK lowering to avoid generating
hlfir.declare with lower bounds inside the RANK CASE (Current situation
would not be incorrect, the lower bounds would be SSA value ending-up
being one, I just want simpler IR).
Renamed to mayHaveNonDefaultLowerBounds since it may still answer yes when
the lower bounds are ones.
show more ...
|
#
fd8b2d20 |
| 30-May-2024 |
jeanPerier <jperier@nvidia.com> |
[flang] lower RANK intrinsic (#93694)
First commit is reviewed in
https://github.com/llvm/llvm-project/pull/93682.
Lower RANK using fir.box_rank. This patches updates fir.box_rank to
accept box
[flang] lower RANK intrinsic (#93694)
First commit is reviewed in
https://github.com/llvm/llvm-project/pull/93682.
Lower RANK using fir.box_rank. This patches updates fir.box_rank to
accept box reference, this avoids the need of generating an assumed-rank
fir.load just for the sake of reading ALLOCATABLE/POINTER rank. The
fir.load would generate a "dynamic" memcpy that is hard to optimize
without further knowledge. A read effect is conditionally given to the
operation.
show more ...
|
Revision tags: llvmorg-18.1.6 |
|
#
1710c8cf |
| 08-May-2024 |
Slava Zakharin <szakharin@nvidia.com> |
[flang] Lowering changes for assigning dummy_scope to hlfir.declare. (#90989)
The lowering produces fir.dummy_scope operation if the current
function has dummy arguments. Each hlfir.declare generat
[flang] Lowering changes for assigning dummy_scope to hlfir.declare. (#90989)
The lowering produces fir.dummy_scope operation if the current
function has dummy arguments. Each hlfir.declare generated
for a dummy argument is then using the result of fir.dummy_scope
as its dummy_scope operand. This is only done for HLFIR.
I was not able to find a reliable way to identify dummy symbols
in `genDeclareSymbol`, so I added a set of registered dummy symbols
that is alive during the variables instantiation for the current
function. The set is initialized during the mapping of the dummy
argument symbols to their MLIR values. It is reset right after
all variables are instantiated - this is done to avoid generating
hlfir.declare operations with dummy_scope for the clones of
the dummy symbols (e.g. this happens with OpenMP privatization).
If this can be done in a cleaner way, please advise.
show more ...
|
Revision tags: llvmorg-18.1.5 |
|
#
fac349a1 |
| 28-Apr-2024 |
Christian Sigg <chsigg@users.noreply.github.com> |
Reapply "[mlir] Mark `isa/dyn_cast/cast/...` member functions depreca… (#90406)
…ted. (#89998)" (#90250)
This partially reverts commit 7aedd7dc754c74a49fe84ed2640e269c25414087.
This change rem
Reapply "[mlir] Mark `isa/dyn_cast/cast/...` member functions depreca… (#90406)
…ted. (#89998)" (#90250)
This partially reverts commit 7aedd7dc754c74a49fe84ed2640e269c25414087.
This change removes calls to the deprecated member functions. It does
not mark the functions deprecated yet and does not disable the
deprecation warning in TypeSwitch. This seems to cause problems with
MSVC.
show more ...
|
#
7aedd7dc |
| 26-Apr-2024 |
dyung <douglas.yung@sony.com> |
Revert "[mlir] Mark `isa/dyn_cast/cast/...` member functions deprecated. (#89998)" (#90250)
This reverts commit 950b7ce0b88318f9099e9a7c9817d224ebdc6337.
This change is causing build failures on
Revert "[mlir] Mark `isa/dyn_cast/cast/...` member functions deprecated. (#89998)" (#90250)
This reverts commit 950b7ce0b88318f9099e9a7c9817d224ebdc6337.
This change is causing build failures on a bot
https://lab.llvm.org/buildbot/#/builders/216/builds/38157
show more ...
|
#
950b7ce0 |
| 26-Apr-2024 |
Christian Sigg <chsigg@users.noreply.github.com> |
[mlir] Mark `isa/dyn_cast/cast/...` member functions deprecated. (#89998)
See https://mlir.llvm.org/deprecation and
https://discourse.llvm.org/t/preferred-casting-style-going-forward.
|
Revision tags: llvmorg-18.1.4, llvmorg-18.1.3 |
|
#
4998587e |
| 26-Mar-2024 |
Daniel Chen <cdchen@ca.ibm.com> |
[Flang] Support for passing procedure pointer, reference to a function that returns a procedure pointer to structure constructor. (#86533)
This PR fixes `not yet implemented: procedure pointer compo
[Flang] Support for passing procedure pointer, reference to a function that returns a procedure pointer to structure constructor. (#86533)
This PR fixes `not yet implemented: procedure pointer component in
structure constructor` as shown in the following test case.
```
MODULE M
TYPE :: DT
PROCEDURE(Fun), POINTER, NOPASS :: pp1
END TYPE
CONTAINS
INTEGER FUNCTION Fun(Arg)
INTEGER :: Arg
Fun = Arg
END FUNCTION
END MODULE
PROGRAM MAIN
USE M
IMPLICIT NONE
TYPE (DT) :: v2
PROCEDURE(FUN), POINTER :: pp2
v2 = DT(pp2)
v2 = DT(bar())
CONTAINS
FUNCTION BAR() RESULT(res)
PROCEDURE(FUN), POINTER :: res
END
END
```
show more ...
|
#
de7a50fb |
| 22-Mar-2024 |
jeanPerier <jperier@nvidia.com> |
[flang] Fix lowering of host associated cray pointee symbols (#86121)
Cray pointee symbols can be host associated from a module or host
procedure while the related cray pointer is not explicitly as
[flang] Fix lowering of host associated cray pointee symbols (#86121)
Cray pointee symbols can be host associated from a module or host
procedure while the related cray pointer is not explicitly associated.
This caused the "not yet implemented: lowering symbol to HLFIR" to fire
when lowering a reference to the cray pointee and fetching the cray
pointer.
This patch:
- Ensures cray pointers are always instantiated when instantiating a
cray pointee.
- Fix internal procedure lowering to deal with cray pointee host
association like it does for pointers (the lowering strategy for cray
pointee is to create a pointer that is updated with the cray pointer
value before being fetched).
This should fix the bug reported in
https://github.com/llvm/llvm-project/issues/85420.
show more ...
|
Revision tags: llvmorg-18.1.2 |
|
#
939f0382 |
| 12-Mar-2024 |
jeanPerier <jperier@nvidia.com> |
[flang] lower vector subscripted polymorphic designators (#84778)
A mold argument need to be added to the hlfir.element_addr and set in
lowering so that when the hlfir.element_addr need to be turne
[flang] lower vector subscripted polymorphic designators (#84778)
A mold argument need to be added to the hlfir.element_addr and set in
lowering so that when the hlfir.element_addr need to be turned into an
hlfir.elemental operation because the designator must be turned into a
value, the mold can be set on the hlfir.elemental to later allocate the
temporary according the the dynamic type.
This situation happens whenever the vector subscripted polymorphic
designator does not appear as an assignment left-hand side, or as an
IO-input item.
I initially thought retrieving the mold would be tricky if the dynamic
type of the designator was set by a part-ref of the right of the vector
subscripts ("array(vector)%polymorphic_comp"), but this turned out to be
impossible because:
1. A derived type component can be polymorphic only if it has the
POINTER or ALLOCATABLE attribute (F2023 C708).
2. Vector-subscripted part are ranked and F2023 C919 prohibits any
part-ref on the right of the rank part to have the POINTER or
ALLOCATABLE attribute.
=> If a vector subscripted designator is polymorphic, the vector
subscripted part is the rightmost part, and the mold is the base of the
vector subscripted part. This makes the retrieval of the mold easy in
lowering. The mold argument is always set to be the base of the vector
subscripted part when lowering the vector subscripted part, and it is
removed at the end of the designator lowering if the designator is not
polymorphic. This way there is no need to find back the mold from the
inside of the hlfir.element_addr body.
show more ...
|
Revision tags: llvmorg-18.1.1 |
|
#
74dfded4 |
| 05-Mar-2024 |
jeanPerier <jperier@nvidia.com> |
[flang] Deallocate structure constructor allocatable components (#83824)
Allocatable components of structure constructors were not deallocated.
Deallocate them without calling final subroutines.
T
[flang] Deallocate structure constructor allocatable components (#83824)
Allocatable components of structure constructors were not deallocated.
Deallocate them without calling final subroutines.
This was already properly done for array constructors.
show more ...
|
Revision tags: llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2 |
|
#
7a4570ac |
| 02-Feb-2024 |
jeanPerier <jperier@nvidia.com> |
[flang] sanitize set_length in lowering (#80412)
In fortran, it is possible to give a negative "i" in "character(i)" in
which case the standard says the length is zero. So the length must be
sanit
[flang] sanitize set_length in lowering (#80412)
In fortran, it is possible to give a negative "i" in "character(i)" in
which case the standard says the length is zero. So the length must be
sanitized as max(0, user_input) in lowering.
This is already done when lowering specification parts, but was not done
when "character(i)" appears in array constructors. Sanitize the length
when lowering SetLength in lowering.
Fixes https://github.com/llvm/llvm-project/issues/80270
show more ...
|
#
cdb320b4 |
| 30-Jan-2024 |
Daniel Chen <cdchen@ca.ibm.com> |
[Flang]: Lowering reference to functions that return a procedure pointer (#78194)
This PR adds lowering the reference to a function that returns a
procedure pointer. It also fixed intrinsic ASSOCIA
[Flang]: Lowering reference to functions that return a procedure pointer (#78194)
This PR adds lowering the reference to a function that returns a
procedure pointer. It also fixed intrinsic ASSOCIATED to take such
argument.
---------
Co-authored-by: jeanPerier <jperier@nvidia.com>
show more ...
|
Revision tags: llvmorg-18.1.0-rc1 |
|
#
a49f630c |
| 26-Jan-2024 |
jeanPerier <jperier@nvidia.com> |
[flang] Lower passing non assumed-rank/size to assumed-ranks (#79145)
Start implementing assumed-rank support as described in
https://github.com/llvm/llvm-project/blob/main/flang/docs/AssumedRank.m
[flang] Lower passing non assumed-rank/size to assumed-ranks (#79145)
Start implementing assumed-rank support as described in
https://github.com/llvm/llvm-project/blob/main/flang/docs/AssumedRank.md
This commit holds the minimal support for lowering calls to procedure
with assumed-rank arguments where the procedure implementation is done
in C.
The case for passing assumed-size to assumed-rank is left TODO since it
will be done a change in assumed-size lowering that is better done in
another patch.
Care is taken to set the lower bounds to zero when passing non allocatable no pointer as descriptor
to a BIND(C) procedure as required per 18.5.3 point 3. This was not done before while the requirements also applies to non assumed-rank descriptors. This change required special attention with IGNORE_TKR(t) to avoid emitting invalid fir.rebox operations (the actual argument type must be used in this case as the output type).
Implementation of Fortran procedure with assumed-rank arguments is still
TODO.
show more ...
|
#
8252137b |
| 25-Jan-2024 |
jeanPerier <jperier@nvidia.com> |
[flang] Lower struct ctor with character allocatable components (#79179)
There is no need to gather the length parameters from the parameter
symbols when facing a deferred length allocatable compon
[flang] Lower struct ctor with character allocatable components (#79179)
There is no need to gather the length parameters from the parameter
symbols when facing a deferred length allocatable components in a
structure constructor, the length is set as part of the assignment given
the value.
Remove the checks for derived type runtime info symbols, this is not
relevant for what is being tested here.
show more ...
|
Revision tags: llvmorg-19-init |
|
#
c373f581 |
| 19-Dec-2023 |
jeanPerier <jperier@nvidia.com> |
[flang] Lower procedure pointer components (#75453)
Lower procedure pointer components, except in the context of structure
constructor (left TODO).
Procedure pointer components lowering share mo
[flang] Lower procedure pointer components (#75453)
Lower procedure pointer components, except in the context of structure
constructor (left TODO).
Procedure pointer components lowering share most of the lowering logic
of procedure poionters with the following particularities:
- They are components, so an hlfir.designate must be generated to
retrieve the procedure pointer address from its derived type base.
- They may have a PASS argument. While there is no dispatching as with
type bound procedure, special care must be taken to retrieve the derived
type component base in this case since semantics placed it in the
argument list and not in the evaluate::ProcedureDesignator.
These components also bring a new level of recursive MLIR types since a
fir.type may now contain a component with an MLIR function type where
one of the argument is the fir.type itself. This required moving the
"derived type in construction" stackto the converter so that the object
and function type lowering utilities share the same state (currently the
function type utilty would end-up creating a new stack when lowering its
arguments, leading to infinite loops). The BoxedProcedurePass also
needed an update to deal with this recursive aspect.
show more ...
|
#
67f9b5ae |
| 05-Dec-2023 |
Valentin Clement (バレンタイン クレメン) <clementval@gmail.com> |
[flang] Fix issue with lookup in the binding table (#74416)
This patch is fixing two issue relative to the dynamic dispatch for
polymorphic entities.
1. Fix the `requireDispatchCall` function. I
[flang] Fix issue with lookup in the binding table (#74416)
This patch is fixing two issue relative to the dynamic dispatch for
polymorphic entities.
1. Fix the `requireDispatchCall` function. It was checking for the first
symbol of the component but this is not the one to be checked. Instead
the last symbol of the base of the component object is the one to check
to know if it is polymorphic object with a dispatch call or not. This is
demonstrated in the new added test in `flang/test/Lower/dispatch.f90`
where the first symbol would point to `q` which is monomorphic and would
result in a simple `fir.call`
2. Fix the pass object in a no pass situation. In a no pass situation
the pass object is lowered anyway to be able to do the lookup in the
binding table. It was previously lowered wrongly an lead to unresolved
lookup. The base of the component is the passed object and should be
lowered. To achieve this, the `gen(DataRef)` entry point is exposed form
`ConvertExprToHLFIR` through a `convertDataRefToValue` function. The
same test added in `flang/test/Lower/dispatch.f90` is checking for the
correct passed object.
In addition couple of tests were updated to HLFIR since the lowering
used only works with it.
show more ...
|
Revision tags: llvmorg-17.0.6 |
|
#
af09219e |
| 22-Nov-2023 |
Daniel Chen <cdchen@ca.ibm.com> |
[Flang] Add partial support for lowering procedure pointer assignment. (#70461)
**Scope of the PR:** 1. Lowering global and local procedure pointer declaration statement with explicit or implicit in
[Flang] Add partial support for lowering procedure pointer assignment. (#70461)
**Scope of the PR:** 1. Lowering global and local procedure pointer declaration statement with explicit or implicit interface. The explicit interface can be from an interface block, a module procedure or an internal procedure. 2. Lowering procedure pointer assignment, where the target procedure could be external, module or internal procedures. 3. Lowering reference to procedure pointers so that it works end to end.
**PR notes:** 1. The first commit of the PR does not include testing. I would like to collect some comments first, which may alter the output. Once I confirm the implementation, I will add some testing as a follow up commit to this PR. 2. No special handling of the host-associated entities when an internal procedure is the target of a procedure pointer assignment in this PR.
**Implementation notes:** 1. The implementation is using the HLFIR path. 2. Flang currently uses `getUntypedBoxProcType` to get the `fir::BoxProcType` for `ProcedureDesignator` when getting the address of a procedure in order to pass it as an actual argument. This PR inherits the same design decision for procedure pointer as the `fir::StoreOp` requires the same memory type.
Note: this commit is actually resubmitting the original commit from PR #70461 that was reverted. See PR #73221.
show more ...
|
#
49f55d10 |
| 23-Nov-2023 |
Muhammad Omair Javaid <omair.javaid@linaro.org> |
Revert "[Flang] Add partial support for lowering procedure pointer assignment. (#70461)"
This reverts commit e07fec10ac208c2868a24c5c0be88e45778b297e.
This change appears to have broken following b
Revert "[Flang] Add partial support for lowering procedure pointer assignment. (#70461)"
This reverts commit e07fec10ac208c2868a24c5c0be88e45778b297e.
This change appears to have broken following buildbots: https://lab.llvm.org/buildbot/#/builders/176 https://lab.llvm.org/buildbot/#/builders/179 https://lab.llvm.org/buildbot/#/builders/184 https://lab.llvm.org/buildbot/#/builders/197 https://lab.llvm.org/buildbot/#/builders/198
All bots fails in testsuite where following tests seems broken: (eg: https://lab.llvm.org/buildbot/#/builders/176/builds/7131)
test-suite::gfortran-regression-compile-regression__proc_ptr_46_f90.test test-suite::gfortran-regression-compile-regression__proc_ptr_37_f90.test
show more ...
|
#
e07fec10 |
| 22-Nov-2023 |
Daniel Chen <cdchen@ca.ibm.com> |
[Flang] Add partial support for lowering procedure pointer assignment. (#70461)
**Scope of the PR:**
1. Lowering global and local procedure pointer declaration statement
with explicit or implicit
[Flang] Add partial support for lowering procedure pointer assignment. (#70461)
**Scope of the PR:**
1. Lowering global and local procedure pointer declaration statement
with explicit or implicit interface. The explicit interface can be from
an interface block, a module procedure or an internal procedure.
2. Lowering procedure pointer assignment, where the target procedure
could be external, module or internal procedures.
3. Lowering reference to procedure pointers so that it works end to end.
**PR notes:**
1. The first commit of the PR does not include testing. I would like to
collect some comments first, which may alter the output. Once I confirm
the implementation, I will add some testing as a follow up commit to
this PR.
2. No special handling of the host-associated entities when an internal
procedure is the target of a procedure pointer assignment in this PR.
**Implementation notes:**
1. The implementation is using the HLFIR path.
2. Flang currently uses `getUntypedBoxProcType` to get the
`fir::BoxProcType` for `ProcedureDesignator` when getting the address of
a procedure in order to pass it as an actual argument. This PR inherits
the same design decision for procedure pointer as the `fir::StoreOp`
requires the same memory type.
show more ...
|