| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
Apply the check for the constraint `C1172` to `unlock-stmt`,
`change-team-stmt`, `end-team-stmt`, and `critical-stmt`, which
all have `sync-stat-lists` and so `C1172` applies to them. Add
a test to check the `sync-stat-lists` for these 4 statements.
Reviewed By: PeteSteinfeld
Differential Revision: https://reviews.llvm.org/D150745
|
|
|
|
|
|
|
| |
This patch fixes:
flang/lib/Semantics/runtime-type-info.cpp:1275:12: error: unused
variable 'name' [-Werror,-Wunused-variable]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Generate supporting data structures and calls to new runtime IO functions
for defined IO that accesses non-type-bound procedures, such as `wft` in:
module m1
type t
integer n
end type
interface write(formatted)
module procedure wft
end interface
contains
subroutine wft(dtv, unit, iotype, v_list, iostat, iomsg)
class(t), intent(in) :: dtv
integer, intent(in) :: unit
character(*), intent(in) :: iotype
integer, intent(in) :: v_list(:)
integer, intent(out) :: iostat
character(*), intent(inout) :: iomsg
iostat = 0
write(unit,*,iostat=iostat,iomsg=iomsg) 'wft was called: ', dtv%n
end subroutine
end module
module m2
contains
subroutine test1
use m1
print *, 'test1, should call wft: ', t(1)
end subroutine
subroutine test2
use m1, only: t
print *, 'test2, should not call wft: ', t(2)
end subroutine
end module
use m1
use m2
call test1
call test2
print *, 'main, should call wft: ', t(3)
end
|
|
|
|
|
|
|
|
|
| |
Symbols corresponding to entries returning character results
must be mapped to EmboxCharOp, first, before we can map them
to DeclareOp. The code may be reworked after HLFIR is enabled
by default, but right now it seems like an acceptable solution to me.
Differential Revision: https://reviews.llvm.org/D150749
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit 65429b9af6a2c99d340ab2dcddd41dab201f399c.
Broke several projects, see https://reviews.llvm.org/D144509#4347562 onwards.
Also reverts follow-up commit "[OpenMP] Compile assembly files as ASM, not C"
This reverts commit 4072c8aee4c89c4457f4f30d01dc9bb4dfa52559.
Also reverts fix attempt "[cmake] Set CMP0091 to fix Windows builds after the cmake_minimum_required bump"
This reverts commit 7d47dac5f828efd1d378ba44a97559114f00fb64.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When Scope::AddSourceRange() is called to extend the scope's source range to
include another snippet from a cooked character stream, add a check to ensure
that the new range is part of the same cooked character stream as the rest
of the scope.
And fix the bug that was causing such invalid source ranges to be created:
a submodule's Scope is a children of its parent's in the Scope tree, but
it may or may not be part of the same source file, and it is certainly
not enclosed in the parent's source range. So don't propagate Scope
source range expansion from a submodule to its parent.
Differential Revision: https://reviews.llvm.org/D150714
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The lowering of hlfir.forall to loops (and later hlfir.where) requires
doing a data dependency analysis to avoid creating temporary storage for
every control/mask/rhs/lhs expressions.
The added code implements a data dependency analysis for the hlfir
ordered assignment trees (it is not specific to Forall since these nodes
includes Where, user defined assignments, and assignment to vector
subscripted entities, but the added code is only plugged and tested
with hlfir.forall in this patch).
This data dependency analysis returns a "schedule", which is a list of
runs containing actions. Each runs will result in a single loop nest
evaluating all its action "at the same time" inside the loop body.
Actions may either evaluating an assignment, or saving some expression
evaluation (the value yielded inside the ordered assignment hlfir operations)
in a temporary storage before doing the assignment that requires this
expression value but may "conflict" with it.
A "conflict" is a read in an expression E to a variable that is, or may
be (analysis is conservative), written by an assignment that depends on
E.
The analysis is based on MLIR SideEffectInterface and fir AliasAnalysis
which makes it generic.
For now, the codegen that will apply the schedule and rewrite the
hlfir.forall into a set of loops is not implemented, but the scheduling
is tested on its own (from Fortran, because it allows testing many cases
in very readable fashions).
The current scheduling has limitations, for instance
"forall(i=1, 10) x(i)=2*x(i)" does not require saving the RHS values for
all "i" before doing the assignments since the RHS does not depend
on values computed during previous iterations. Any user call will also
trigger a conservative assumption that there is a conflict. Finally,
a lot of operations are missing memory effect interfaces (especially
in HLFIR). This patch adds a few so that it can be tested, but more
will be added in later patches.
Differential Revision: https://reviews.llvm.org/D150455
|
|
|
|
| |
This option was renamed a long time ago in commit 388cefa78d.
|
|
|
|
|
|
| |
I just broke the test llvm-test-suite/Fortran/gfortran/torture/execute/st_function_1.f90
with a recent patch. The bug was obvious, as is the fix, which works, so
I'm just pushing it directly to make the build bots happy.
|
|
|
|
|
|
|
|
|
|
|
| |
Fortran doesn't allow inaccessible procedure bindings to be
overridden, and this needs to apply to generic resolution.
When resolving a type-bound generic procedure from another
module, ensure only that the most extended override from its
module is used if it is PRIVATE, not a later apparent override
from another module.
Differential Revision: https://reviews.llvm.org/D150721
|
|
|
|
|
|
|
|
|
| |
Incorrect error messages were issuing for symbol table entries
with the CONTIGUOUS attribute that didn't deserve them, like
host association symbols. Put the CONTIGUOUS check into
CheckObjectEntity().
Differential Revision: https://reviews.llvm.org/D150712
|
|
|
|
|
|
|
|
|
|
|
| |
Establish a set of optional usage warnings, and enable some
only in "-pedantic" mode that, in our subjective experience
with application codes, seem to issue frequently without
indicating usage that really needs to be corrected. By default,
with this patch the compiler should appear to be somewhat less
persnickety but not less informative.
Differential Revision: https://reviews.llvm.org/D150710
|
|
|
|
|
|
|
|
|
|
|
| |
In the CoarrayChecker, add checks for the constraints C1177 and
C1178 for event-wait-stmt. Add event-post-stmt to the check
for the constraints for sync-stat-list. Add a check for the
constraint C1176 on event-variable.
Reviewed By: PeteSteinfeld
Differential Revision: https://reviews.llvm.org/D137204
|
|
|
|
| |
This reverts commit 9725c740fbe7841a7aed57ca35f83d28aac1814c.
|
|
|
|
|
|
|
|
|
|
| |
test.
Missed adding this check in previous commit so adding it through separate commit.
Reviewed By: raghavendhra
Differential Revision: https://reviews.llvm.org/D150626
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The right-hand sides of assignment statements are always expressions,
never variables. When an assignment statement is converted into a call
to a defined assignment subroutine, and the actual argument being associated
with the second dummy argument is a variable, and the dummy argument does
not have the VALUE attribute, wrap it with parentheses so that lowering
will pass it by means of a temporary.
Fixes https://github.com/llvm/llvm-project/issues/62599.
Differential Revision: https://reviews.llvm.org/D150331
|
|
|
|
|
|
|
|
|
|
|
| |
Apply the default PUBLIC/PRIVATE accessibility of a module to its symbols
a second time after it is known that all symbols, including implicitly typed
names from NAMELIST groups and specification expressions in module subprograms,
have been created in its scope.
Fixes https://github.com/llvm/llvm-project/issues/62598.
Differential Revision: https://reviews.llvm.org/D150307
|
|
|
|
|
|
|
|
|
|
|
| |
(bug #58732)
After tokenizing an identifier, don't allow the next token to be a
Hollerith literal.
Fixes https://github.com/llvm/llvm-project/issues/58732.
Differential Revision: https://reviews.llvm.org/D150406
|
|
|
|
|
|
|
| |
The two constants should be equal only if their derived types
are the same. This fixes regression caused by D150380.
Differential Revision: https://reviews.llvm.org/D150634
|
|
|
|
|
|
|
|
|
|
|
| |
In the CoarrayChecker, add checks for the constraints C1177 and
C1178 for event-wait-stmt. Add event-post-stmt to the check
for the constraints for sync-stat-list. Add a check for the
constraint C1176 on event-variable.
Reviewed By: PeteSteinfeld
Differential Revision: https://reviews.llvm.org/D137204
|
|
|
|
|
|
|
|
|
|
| |
Lower host_data construct to the acc.host_data operation.
Depends on D150289
Reviewed By: razvanlupusoru, jeanPerier
Differential Revision: https://reviews.llvm.org/D150290
|
|
|
|
|
|
|
|
|
| |
The temporary descriptor must be either Pointer or Allocatable,
otherwise its memory will not be freed.
Reviewed By: klausler
Differential Revision: https://reviews.llvm.org/D150534
|
|
|
|
|
|
| |
Reviewed By: klausler
Differential Revision: https://reviews.llvm.org/D150533
|
|
|
|
|
|
| |
Reviewed By: jeanPerier
Differential Revision: https://reviews.llvm.org/D150502
|
|
|
|
|
|
| |
Reviewed By: jeanPerier
Differential Revision: https://reviews.llvm.org/D150501
|
|
|
|
|
|
| |
Depends on: D150272
Differential Revision: https://reviews.llvm.org/D150451
|
|
|
|
|
|
|
|
| |
Carries out the lowering of the any intrinsic into HLFIR
Depends on: D149964
Differential Revision: https://reviews.llvm.org/D150272
|
|
|
|
|
|
|
| |
Adds a HLFIR operation for the ANY intrinsic according to the
design set out in flang/docs/HighLevel.md
Differential Revision: https://reviews.llvm.org/D149964
|
|
|
|
|
|
| |
The owner of the last two failing buildbots updated CMake.
This reverts commit e8e8707b4aa6e4cc04c0cffb2de01d2de71165fc.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The global names were created using a hash based on the address
of std::vector::data address. Since the memory may be reused
by different std::vector's, this may cause non-equivalent
constant expressions to map to the same name. This is what is happening
in the modified flang/test/Lower/constant-literal-mangling.f90 test.
I changed the name creation to use a map between the constant expressions
and corresponding unique names. The uniquing is done using a name counter
in FirConverter. The effect of this change is that the equivalent
constant expressions are now mapped to the same global, and the naming
is "stable" (i.e. it does not change from compilation to compilation).
Though, the issue is not HLFIR specific it was affecting several tests
when using HLFIR lowering.
Differential Revision: https://reviews.llvm.org/D150380
|
|
|
|
|
|
| |
The codegen tried to fir.convert !fir.box to !fir.ref for this case.
I used BoxAddr under a check for the type mismatch, but I am not sure
if this is the right fix. Maybe it has to be handled in the lowering.
|
|
|
|
|
|
|
|
|
|
| |
Update _OPENACC definition to be consistent with the flang-new
driver. Currently set to 202011 which is OpenACC 3.1 specification and
is the current parser/semantic status.
Reviewed By: razvanlupusoru
Differential Revision: https://reviews.llvm.org/D150400
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D150393
|
|
|
|
|
|
|
|
|
|
| |
Instead of calling _FortranASizeDim, we can instead load extent
directly from descriptor. Add this support for cases where dim
is a known constant at compile time.
Reviewed By: clementval
Differential Revision: https://reviews.llvm.org/D150385
|
|
|
|
|
|
|
|
|
|
| |
The information needed for translation is now encoded in the dialect
operations and does not require a dedicated pass to be extracted.
Remove the obsolete passes that were performing operand legalization.
Reviewed By: jeanPerier
Differential Revision: https://reviews.llvm.org/D150248
|
|
|
|
|
|
|
|
|
| |
The bufferization pass must create the tuple for these operations, because
the users may require it. For example, in case of ElementalOp inlining
a DestroyOp may be generated for the operand of YieldElementOp, and
the operand may be ApplyOp->NoReassocOp chain.
Differential Revision: https://reviews.llvm.org/D150343
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On Windows, global string literals with "linkonce" linkage is not
supported without using comdat. As a simpler fix than adding comdat
support we can use internal linkage instead.
This fixes a bug where two string literals with the same value in
different fortran files would cause a linker error due to the use
of linkonce linkage.
Reviewed By: jeanPerier
Differential Revision: https://reviews.llvm.org/D149859
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently complex division is lowered to a fir.divc operation and the
fir.divc is later converted to a sequence of llvm operations to perform
complex division, however this causes issues for extreme values when
the calculations overflow.
This patch changes the lowering of complex division to use the Intrinsic
Call functionality to lower into library calls (for single, double,
extended and quad precisions) or an MLIR complex dialect division operation
(for half and bfloat precisions).
A new wrapper function `genLibSplitComplexArgsCall` is written to handle
the case of the arguments of the Complex Library calls being split to
its real and imaginary real components.
Note 1: If the Complex To Standard conversion of division operation
matures then we can use it for all precisions. Currently it has the
same issues as the conversion of fir.divc.
Note 2: A previous patch (D145808) did the same but during conversion of
the fir.divc operation. But using function calls at that stage leads to
ABI issues since the conversion to LLVM is not aware of the complex target
rewrite.
Note 3: If the patch is accepted, fir.divc can be removed from FIR. We
can use the complex.div operation where any transformation is required.
Reviewed By: vzakhari, PeteSteinfeld, DavidTruby, jeanPerier
Differential Revision: https://reviews.llvm.org/D149546
|
|
|
|
|
|
|
|
| |
on OMP TARGET DATA directive.
Reviewed By: kiranchandramohan
Differential Revision: https://reviews.llvm.org/D149815
|
|
|
|
|
|
|
|
| |
OpenMP 5.2 introduces a Fortran specific construct that aims to replace the executable allocate directive. This patch seeks to add parser support for the directive as well as the allocator clause with the [[ https://www.openmp.org/wp-content/uploads/OpenMP-API-Specification-5-2.pdf#section.6.6 | extended align/complex ]] modifier.
Reviewed By: kiranchandramohan
Differential Revision: https://reviews.llvm.org/D149727
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Remove old clause operands from acc.kernels operation since
the new dataOperands is now in place.
private and firstprivate will receive some redesign but are
not part of the new dataOperands.
Depends on D150224
Reviewed By: vzakhari
Differential Revision: https://reviews.llvm.org/D150225
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Remove old clause operands from acc.serial operation since
the new dataOperands is now in place.
private and firstprivate will receive some redesign but are
not part of the new dataOperands.
Depends on D150207
Reviewed By: vzakhari
Differential Revision: https://reviews.llvm.org/D150224
|
|
|
|
|
|
|
|
|
|
|
| |
The order of operand in clauses that are decomposed was not
preserved. This patch change how operands are handled and preserve
the user ordering for the entry data operation on the acc.parallel
operation.
Reviewed By: vzakhari
Differential Revision: https://reviews.llvm.org/D150214
|
|
|
|
|
|
|
|
|
|
|
| |
The order of operand in clauses that are decomposed was not
preserved. This patch change how operands are handled and preserve
the user ordering for the entry data operation on the acc.data
operation.
Reviewed By: vzakhari
Differential Revision: https://reviews.llvm.org/D150213
|
|
|
|
|
|
|
|
|
|
|
| |
Remove old clause operands from acc.parallel operation since
the new dataOperands is now in place.
private, firstprivate and reductions will receive some redesign but are
not part of the new dataOperands.
Reviewed By: razvanlupusoru
Differential Revision: https://reviews.llvm.org/D150207
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The lowerbound was not correctly normalized to 0 when the bound
are generated for an array without subscripts.
```
integer :: a(11:20)
!$acc enter data create(a)
```
Reviewed By: razvanlupusoru
Differential Revision: https://reviews.llvm.org/D150208
|
|
|
|
|
|
|
|
|
| |
The implied-do index value has 'index' type, and it has to be
converted to the original ac-do-variable's data type.
Reviewed By: jeanPerier
Differential Revision: https://reviews.llvm.org/D150150
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since the new data operand operations have been added in D148389 and
adopted on acc.data in D149673, the old clause operands are no longer
needed.
The LegalizeDataOpForLLVMTranslation will become obsolete when all
operations will be cleaned. For the time being only the appropriate
part are being removed.
processOperands will also receive some updates once all the operands
will be coming from an acc data operand operation.
Reviewed By: razvanlupusoru
Differential Revision: https://reviews.llvm.org/D150155
|
|
|
|
| |
This reverts commit 626aa8518d873c5760cd033fe49b1809c9de3494.
|