#
3a8a52f4 |
| 08-Jan-2025 |
Peter Klausler <pklausler@nvidia.com> |
[flang] Make IsCoarray() more accurate (#121415)
A designator without cosubscripts can have subscripts, component
references, substrings, &c. and still have corank. The current
IsCoarray() predica
[flang] Make IsCoarray() more accurate (#121415)
A designator without cosubscripts can have subscripts, component
references, substrings, &c. and still have corank. The current
IsCoarray() predicate only seems to work for whole variable/component
references. This was breaking some cases of THIS_IMAGE().
show more ...
|
#
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 ...
|
#
d2126ec1 |
| 10-Sep-2024 |
Peter Klausler <pklausler@nvidia.com> |
[flang] Fix bogus error about procedure incompatbility (#107645)
This was a subtle problem. When the shape of a function result is
explicit but not constant, it is characterized with bounds express
[flang] Fix bogus error about procedure incompatbility (#107645)
This was a subtle problem. When the shape of a function result is
explicit but not constant, it is characterized with bounds expressions
that use Extremum<SubscriptInteger> operations to force extents to 0
rather than be negative. These Extremum operations are formatted as
"max()" intrinsic functions in the module file. Upon being read from the
module file, they are not folded back into Extremum operations, but
remain as function references; and this then leads to expressions not
comparing equal when the procedure characteristics are compared to those
of a local procedure declared identically.
The real fix here would be for folding to just always change max and min
function references into Extremum<> operations, constant operands or
not, and I tried that, but it lead to test failures and crashes in
lowering that I couldn't resolve. So, until those can be fixed, here's a
change that will read max/min operations in module file declarations
back into Extremum operations to solve the compatibility checking
problem, but leave other non-constant max/min operations as function
calls.
show more ...
|
#
01688ee9 |
| 24-Oct-2022 |
Peter Klausler <pklausler@nvidia.com> |
[flang] Accommodate unknowable CHARACTER length in evaluate::ArrayConstructor<>
The internal representation for array constructors in expressions during semantic analysis needs to be able to accommo
[flang] Accommodate unknowable CHARACTER length in evaluate::ArrayConstructor<>
The internal representation for array constructors in expressions during semantic analysis needs to be able to accommodate circumstances (e.g. TRIM(), substrings) in which the length of the elements in the array is either unknown or cannot be represented as a context-free integer expression.
Differential Revision: https://reviews.llvm.org/D139041
show more ...
|
#
cd03e96f |
| 23-Mar-2022 |
Peter Klausler <pklausler@nvidia.com> |
[flang] Add & use a better visit() (take 2)
Adds flang/include/flang/Common/log2-visit.h, which defines a Fortran::common::visit() template function that is a drop-in replacement for std::visit().
[flang] Add & use a better visit() (take 2)
Adds flang/include/flang/Common/log2-visit.h, which defines a Fortran::common::visit() template function that is a drop-in replacement for std::visit(). Modifies most use sites in the front-end and runtime to use common::visit().
The C++ standard mandates that std::visit() have O(1) execution time, which forces implementations to build dispatch tables. This new common::visit() is O(log2 N) in the number of alternatives in a variant<>, but that N tends to be small and so this change produces a fairly significant improvement in compiler build memory requirements, a 5-10% improvement in compiler build time, and a small improvement in compiler execution time.
Building with -DFLANG_USE_STD_VISIT causes common::visit() to be an alias for std::visit().
Calls to common::visit() with multiple variant arguments are referred to std::visit(), pending further work.
This change is enabled only for GCC builds with GCC >= 9; an earlier attempt (D122441) ran into bugs in some versions of clang and was reverted rather than simply disabled; and it is not well tested with MSVC. In non-GCC and older GCC builds, common::visit() is simply an alias for std::visit().
show more ...
|
#
4ca111d4 |
| 28-Mar-2022 |
Andrzej Warzynski <andrzej.warzynski@arm.com> |
Revert "[flang] Add & use a better visit()"
This reverts commit 2ab9990c9eb79682a4d4b183dfbc7612d3e55328. It has caused multiple build failures: * https://lab.llvm.org/buildbot/#/builders/177/build
Revert "[flang] Add & use a better visit()"
This reverts commit 2ab9990c9eb79682a4d4b183dfbc7612d3e55328. It has caused multiple build failures: * https://lab.llvm.org/buildbot/#/builders/177/builds/4346 * https://lab.llvm.org/buildbot/#/builders/180/builds/3803 * https://lab.llvm.org/buildbot/#/builders/175/builds/10419 * https://lab.llvm.org/buildbot/#/builders/191/builds/4318 * https://lab.llvm.org/buildbot/#/builders/173/builds/4274 * https://lab.llvm.org/buildbot/#/builders/181/builds/4297
All these bots failed with a time-out: ``` command timed out: 1200 seconds without output running [b'ninja', b'-j', b'32'], attempting to kill ``` I'm guessing that that's due to template instantiations failing at some point (https://reviews.llvm.org/D122441 introduced a custom implementation of std::visit). Everything seems fine when either: * building on X86 with GCC or Clang (tested with GCC 9.3 and Clang 12) * building on AArch64 with GCC (tested with GCC 11)
show more ...
|
#
2ab9990c |
| 23-Mar-2022 |
Peter Klausler <pklausler@nvidia.com> |
[flang] Add & use a better visit()
Adds flang/include/flang/Common/visit.h, which defines a Fortran::common::visit() template function that is a drop-in replacement for std::visit(). Modifies most
[flang] Add & use a better visit()
Adds flang/include/flang/Common/visit.h, which defines a Fortran::common::visit() template function that is a drop-in replacement for std::visit(). Modifies most use sites in the front-end and runtime to use common::visit().
The C++ standard mandates that std::visit() have O(1) execution time, which forces implementations to build dispatch tables. This new common::visit() is O(log2 N) in the number of alternatives in a variant<>, but that N tends to be small and so this change produces a fairly significant improvement in compiler build memory requirements, a 5-10% improvement in compiler build time, and a small improvement in compiler execution time.
Building with -DFLANG_USE_STD_VISIT causes common::visit() to be an alias for std::visit().
Calls to common::visit() with multiple variant arguments are referred to std::visit(), pending further work.
Differential Revision: https://reviews.llvm.org/D122441
show more ...
|
#
5c5bde1b |
| 30-Dec-2021 |
Peter Klausler <pklausler@nvidia.com> |
[flang] Fold SCALE()
Fold references to the intrinsic function SCALE().
(Also work around some MSVC headaches somehow exposed by this patch: disable a bogus MSVC warning that began to appear in unr
[flang] Fold SCALE()
Fold references to the intrinsic function SCALE().
(Also work around some MSVC headaches somehow exposed by this patch: disable a bogus MSVC warning that began to appear in unrelated source files, and avoid the otherwise-necessary use of the "template" keyword in a call to a template member function of a class template.)
Differential Revision: https://reviews.llvm.org/D117150
show more ...
|
#
7a6ab39e |
| 01-Oct-2021 |
Jean Perier <jperier@nvidia.com> |
[flang] Revert 3 commits pushed by mistake along b7c07ce15ffe6da9dcd69d457a3eca987452edc7
Revert "[flang][NFC] Add debug dump method to evaluate::Expr and semantics::Symbol" This reverts commit b0e3
[flang] Revert 3 commits pushed by mistake along b7c07ce15ffe6da9dcd69d457a3eca987452edc7
Revert "[flang][NFC] Add debug dump method to evaluate::Expr and semantics::Symbol" This reverts commit b0e35fde21ecb47799603e1acfc9ffa7b83dea13.
Revert "[flang] Add a wrapper for Fortran main program" This reverts commit 2c1ce0755e09909c41db93845c4c3f42457cb9c8.
Revert "[flang][NFC] Fix header comments in some runtime headers" This reverts commit a63f57674d511eb287edbabad9674c6298cf8b84.
show more ...
|
#
b0e35fde |
| 30-Sep-2021 |
Jean Perier <jperier@nvidia.com> |
[flang][NFC] Add debug dump method to evaluate::Expr and semantics::Symbol
Helps debugging when working with symbol/expression issue. The dump method is easy to call in the debugger.
|
#
fdcbb540 |
| 30-Sep-2021 |
Jean Perier <jperier@nvidia.com> |
[flang][NFC] Add debug dump method to evaluate::Expr and semantics::Symbol
Helps debugging when working with symbol/expression issue. The dump method is easy to call in the debugger.
Co-authored-by
[flang][NFC] Add debug dump method to evaluate::Expr and semantics::Symbol
Helps debugging when working with symbol/expression issue. The dump method is easy to call in the debugger.
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Differential Revision: https://reviews.llvm.org/D110856
show more ...
|
#
f6ecea1a |
| 22-Sep-2021 |
peter klausler <pklausler@nvidia.com> |
[flang] Represent (parentheses around derived types)
The strongly typed expression representation classes supported a representation of parentheses only around intrinsic types with specific kinds.
[flang] Represent (parentheses around derived types)
The strongly typed expression representation classes supported a representation of parentheses only around intrinsic types with specific kinds. Parentheses around derived type variables must also be preserved so that expressions may be distinguished from variables; this distinction matters for actual arguments & construct associations.
Differential Revision: https://reviews.llvm.org/D110355
show more ...
|
#
b34f1168 |
| 04-Sep-2020 |
Peter Steinfeld <psteinfeld@nvidia.com> |
[flang] Fix assert on constant folding of extended types
When we define a derived type that extends another derived type, we can then create a structure constructor that contains values for the fiel
[flang] Fix assert on constant folding of extended types
When we define a derived type that extends another derived type, we can then create a structure constructor that contains values for the fields of both the child type and its parent. The compiler's internal representation of that value contains the name of the parent type where a component name would normally appear. This caused an assert during contant folding.
There are three cases for components that appear in structure constructors. The first is the normal case of a component appearing in a structure constructor for its type.
The second is a component of the parent (or grandparent) type appearing in a structure constructor for the child type.
The third is the parent type component, which can appear in the structure constructor of its child.
There are also cases where the component can be arrays.
I created the test case folding12.f90 that covers all of these cases and modified the code to handle them.
Most of my changes were to the "Find()" method of the type "StructureConstructor" where I added code to cover the second and third cases described above. To handle these cases, I needed to create a "StructureConstructor" for the parent type component and return it. To handle returning a newly created "StructureConstructor", I changed the return type of "Find()" to be "std::optional" rather than an ordinary pointer.
This change supersedes D86172.
Differential Revision: https://reviews.llvm.org/D87151
show more ...
|
#
8a8bb078 |
| 09-Jul-2020 |
peter klausler <pklausler@nvidia.com> |
[flang] Fix frontend build with -DBUILD_SHARED_LIBS=On
Fix fronted shared library builds by eliminating dependences of the parser on other component libraries, moving some code around that wasn't in
[flang] Fix frontend build with -DBUILD_SHARED_LIBS=On
Fix fronted shared library builds by eliminating dependences of the parser on other component libraries, moving some code around that wasn't in the right library, and making some dependences explicit in the CMakeLists.txt files. The lowering library does not yet build as a shared library due to some undefined names.
Reviewed By: tskeith
Differential Revision: https://reviews.llvm.org/D83515
show more ...
|
#
1f879005 |
| 29-Mar-2020 |
Tim Keith <tkeith@nvidia.com> |
[flang] Reformat with latest clang-format and .clang-format
Original-commit: flang-compiler/f18@9fe84f45d7fd685051004678d6b5775dcc4c6f8f Reviewed-on: https://github.com/flang-compiler/f18/pull/1094
|
#
8670e499 |
| 28-Feb-2020 |
Caroline Concatto <caroline.concatto@arm.com> |
[flang] [LLVMify F18] Replace the use std::ostream with LLVM streams llvm::ostream
This patch replaces the occurrence of std::ostream by llvm::raw_ostream. In LLVM Coding Standards[1] "All new code
[flang] [LLVMify F18] Replace the use std::ostream with LLVM streams llvm::ostream
This patch replaces the occurrence of std::ostream by llvm::raw_ostream. In LLVM Coding Standards[1] "All new code should use raw_ostream instead of ostream".[1]
As a consequence, this patch also replaces the use of: std::stringstream by llvm::raw_string_ostream or llvm::raw_ostream* std::ofstream by llvm::raw_fd_ostream std::endl by '\n' and flush()[2] std::cout by llvm::outs() and std::cerr by llvm::errs()
It also replaces std::strerro by llvm::sys::StrError** , but NOT in Fortran runtime libraries
*std::stringstream were replaced by llvm::raw_ostream in all methods that used std::stringstream as a parameter. Moreover, it removes the pointers to these streams.
[1]https://llvm.org/docs/CodingStandards.html [2]https://releases.llvm.org/2.5/docs/CodingStandards.html#ll_avoidendl
Signed-off-by: Caroline Concatto <caroline.concatto@arm.com>
Running clang-format-7
Signed-off-by: Caroline Concatto <caroline.concatto@arm.com>
Removing residue of ostream library
Signed-off-by: Caroline Concatto <caroline.concatto@arm.com>
Original-commit: flang-compiler/f18@a3507d44b8911e6024033aa583c1dc54e0eb89fd Reviewed-on: https://github.com/flang-compiler/f18/pull/1047
show more ...
|
#
38ebace5 |
| 13-Mar-2020 |
peter klausler <pklausler@nvidia.com> |
[flang] Complete formatting of pointer assignments, move to formatting.cpp with rest of AsFortran
Original-commit: flang-compiler/f18@9625317ee8aed40a3827fe551cecf08aa34ee7a2 Reviewed-on: https://gi
[flang] Complete formatting of pointer assignments, move to formatting.cpp with rest of AsFortran
Original-commit: flang-compiler/f18@9625317ee8aed40a3827fe551cecf08aa34ee7a2 Reviewed-on: https://github.com/flang-compiler/f18/pull/1073
show more ...
|
#
e03b20e6 |
| 10-Mar-2020 |
peter klausler <pklausler@nvidia.com> |
[flang] Changes to get a clean build of f18 with latest clang
Prep for review
Original-commit: flang-compiler/f18@111f49061e07604670614250197a1064959fd981 Reviewed-on: https://github.com/flang-comp
[flang] Changes to get a clean build of f18 with latest clang
Prep for review
Original-commit: flang-compiler/f18@111f49061e07604670614250197a1064959fd981 Reviewed-on: https://github.com/flang-compiler/f18/pull/1059
show more ...
|
#
64ab3302 |
| 25-Feb-2020 |
CarolineConcatto <51754594+CarolineConcatto@users.noreply.github.com> |
[flang] [LLVMify F18] Compiler module folders should have capitalised names (flang-compiler/f18#980)
This patch renames the modules in f18 to use a capital letter in the
module name
Signed-off-b
[flang] [LLVMify F18] Compiler module folders should have capitalised names (flang-compiler/f18#980)
This patch renames the modules in f18 to use a capital letter in the
module name
Signed-off-by: Caroline Concatto <caroline.concatto@arm.com>
Original-commit: flang-compiler/f18@d2eb7a1c443d1539ef12b6f027074a0eb15b1ea0 Reviewed-on: https://github.com/flang-compiler/f18/pull/980
show more ...
|