Revision tags: llvmorg-15.0.0-rc1, llvmorg-16-init |
|
#
95f4ca7f |
| 22-Jul-2022 |
Peter Klausler <pklausler@nvidia.com> |
[flang] Allow restricted specific intrinsic functions as implicitly-interfaced procedure pointer targets
The predicate "CanBeCalledViaImplicitInterface()" was returning false for restricted specific
[flang] Allow restricted specific intrinsic functions as implicitly-interfaced procedure pointer targets
The predicate "CanBeCalledViaImplicitInterface()" was returning false for restricted specific intrinsic functions (e.g., SIN) because their procedure characteristics have the elemental attribute; this leads to a bogus semantic error when one attempts to use them as proc-targets in procedure pointer assignment statements when the left-hand side of the assignment is a procedure pointer with an implicit interface. However, these restricted specific intrinsic functions have always been allowed as special cases for such usage -- it is as if they are elemental when it is necessary for them to be so, but not when it's a problem.
Differential Revision: https://reviews.llvm.org/D130386
show more ...
|
#
62d874f2 |
| 08-Jul-2022 |
Peter Klausler <pklausler@nvidia.com> |
[flang] Refine semantic checks for procedure pointer assignment
Some procedure pointers and EXTERNAL procedures have neither explicit interfaces nor result types; these procedures are obviously not
[flang] Refine semantic checks for procedure pointer assignment
Some procedure pointers and EXTERNAL procedures have neither explicit interfaces nor result types; these procedures are obviously not known to be functions, but they could be, so semantics must not assume that they are necessarily subroutines. Refine the procedure pointer / dummy procedure compatibility check to handle these more ambiguous cases and not elicit inappropriate error messages.
Differential Revision: https://reviews.llvm.org/D129674
show more ...
|
Revision tags: llvmorg-14.0.6, llvmorg-14.0.5, llvmorg-14.0.4, llvmorg-14.0.3, llvmorg-14.0.2, llvmorg-14.0.1 |
|
#
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 ...
|
Revision tags: llvmorg-14.0.0, llvmorg-14.0.0-rc4, llvmorg-14.0.0-rc3, llvmorg-14.0.0-rc2, llvmorg-14.0.0-rc1 |
|
#
7763c014 |
| 08-Feb-2022 |
Peter Klausler <pklausler@nvidia.com> |
[flang] Accept pointer assignment w/ remapping to function result
When a pointer assignment with bounds remapping has a function reference as its right-hand side, don't check for array conformance.
[flang] Accept pointer assignment w/ remapping to function result
When a pointer assignment with bounds remapping has a function reference as its right-hand side, don't check for array conformance.
Differential Revision: https://reviews.llvm.org/D119845
show more ...
|
Revision tags: llvmorg-15-init, llvmorg-13.0.1, llvmorg-13.0.1-rc3, llvmorg-13.0.1-rc2, llvmorg-13.0.1-rc1 |
|
#
48dc5c8e |
| 04-Nov-2021 |
Kiran Chandramohan <kiran.chandramohan@arm.com> |
[Flang][OpenMP] Use the ultimate symbol in a call to the IsPointer function
The IsPointer check currently fails for host-associated symbols in OpenMP regions. This causes some failures in semantic c
[Flang][OpenMP] Use the ultimate symbol in a call to the IsPointer function
The IsPointer check currently fails for host-associated symbols in OpenMP regions. This causes some failures in semantic checks for pointer association in an OpenMP region. Fix is to use the ultimate symbol in the call to the IsPointer function in CheckPointerAssignment function in lib/Semantics/pointer-assignment.cpp.
Reviewed By: klausler, peixin
Differential Revision: https://reviews.llvm.org/D112876
show more ...
|
Revision tags: llvmorg-13.0.0, llvmorg-13.0.0-rc4 |
|
#
bcb2591b |
| 17-Sep-2021 |
peter klausler <pklausler@nvidia.com> |
[flang] More checking of NULL pointer actual arguments
Catch additional missing error cases for typed and untyped NULL actual arguments to non-intrinsic procedures in cases of explicit and implicit
[flang] More checking of NULL pointer actual arguments
Catch additional missing error cases for typed and untyped NULL actual arguments to non-intrinsic procedures in cases of explicit and implicit interfaces.
Differential Revision: https://reviews.llvm.org/D110003
show more ...
|
Revision tags: llvmorg-13.0.0-rc3, llvmorg-13.0.0-rc2, llvmorg-13.0.0-rc1, llvmorg-14-init, llvmorg-12.0.1, llvmorg-12.0.1-rc4, llvmorg-12.0.1-rc3, llvmorg-12.0.1-rc2 |
|
#
562bfe12 |
| 15-Jun-2021 |
peter klausler <pklausler@nvidia.com> |
[flang] Complain about more cases of calls to insufficiently defined procedures
When a function is called in a specification expression, it must be sufficiently defined, and cannot be a recursive ca
[flang] Complain about more cases of calls to insufficiently defined procedures
When a function is called in a specification expression, it must be sufficiently defined, and cannot be a recursive call (10.1.11(5)). The best fix for this is to change the contract for the procedure characterization infrastructure to catch and report such errors, and to guarantee that it does emit errors on failed characterizations. Some call sites were adjusted to avoid cascades.
Differential Revision: https://reviews.llvm.org/D104330
show more ...
|
#
dfecbcae |
| 03-Jun-2021 |
peter klausler <pklausler@nvidia.com> |
[flang] CheckConformance: tristate-ify result
To ensure that errors are emitted by CheckConformance and its callers in all situations, it's necessary for the returned result of that function to dist
[flang] CheckConformance: tristate-ify result
To ensure that errors are emitted by CheckConformance and its callers in all situations, it's necessary for the returned result of that function to distinguish between three possible outcomes: the arrays are known to conform at compilation time, the arrays are known to not conform (and a message has been produced), and an indeterminate result in which is not possible to determine conformance. So convert CheckConformance's result into an optional<bool>, and convert its confusing Boolean flag arguments into a bit-set of named flags too.
Differential Revision: https://reviews.llvm.org/D103654
show more ...
|
Revision tags: llvmorg-12.0.1-rc1, llvmorg-12.0.0, llvmorg-12.0.0-rc5, llvmorg-12.0.0-rc4, llvmorg-12.0.0-rc3, llvmorg-12.0.0-rc2, llvmorg-11.1.0, llvmorg-11.1.0-rc3, llvmorg-12.0.0-rc1, llvmorg-13-init, llvmorg-11.1.0-rc2, llvmorg-11.1.0-rc1, llvmorg-11.0.1, llvmorg-11.0.1-rc2 |
|
#
d6a74ec8 |
| 15-Dec-2020 |
peter klausler <pklausler@nvidia.com> |
[flang] Fix false error message for "ptr => func()" array conformance
Pointers must have deferred shapes, so CheckConformance must be extended to allow for them.
Differential Revision: https://revi
[flang] Fix false error message for "ptr => func()" array conformance
Pointers must have deferred shapes, so CheckConformance must be extended to allow for them.
Differential Revision: https://reviews.llvm.org/D93320
show more ...
|
#
641ede93 |
| 07-Dec-2020 |
peter klausler <pklausler@nvidia.com> |
[flang] Improve initializer semantics, esp. for component default values
This patch plugs many holes in static initializer semantics, improves error messages for default initial values and other com
[flang] Improve initializer semantics, esp. for component default values
This patch plugs many holes in static initializer semantics, improves error messages for default initial values and other component properties in parameterized derived type instantiations, and cleans up several small issues noticed during development. We now do proper scalar expansion, folding, and type, rank, and shape conformance checking for component default initializers in derived types and PDT instantiations. The initial values of named constants are now guaranteed to have been folded when installed in the symbol table, and are no longer folded or scalar-expanded at each use in expression folding. Semantics documentation was extended with information about the various kinds of initializations in Fortran and when each of them are processed in the compiler.
Some necessary concomitant changes have bulked this patch out a bit: * contextual messages attachments, which are now produced for parameterized derived type instantiations so that the user can figure out which instance caused a problem with a component, have been added as part of ContextualMessages, and their implementation was debugged * several APIs in evaluate::characteristics was changed so that a FoldingContext is passed as an argument rather than just its intrinsic procedure table; this affected client call sites in many files * new tools in Evaluate/check-expression.cpp to determine when an Expr actually is a single constant value and to validate a non-pointer variable initializer or object component default value * shape conformance checking has additional arguments that control whether scalar expansion is allowed * several now-unused functions and data members noticed and removed * several crashes and bogus errors exposed by testing this new code were fixed * a -fdebug-stack-trace option to enable LLVM's stack tracing on a crash, which might be useful in the future
TL;DR: Initialization processing does more and takes place at the right times for all of the various kinds of things that can be initialized.
Differential Review: https://reviews.llvm.org/D92783
show more ...
|
Revision tags: llvmorg-11.0.1-rc1, llvmorg-11.0.0, llvmorg-11.0.0-rc6, llvmorg-11.0.0-rc5, llvmorg-11.0.0-rc4 |
|
#
c7574188 |
| 25-Sep-2020 |
Peter Steinfeld <psteinfeld@nvidia.com> |
[flang] Failed call to CHECK() for call to ASSOCIATED(NULL())
Calling "ASSOCATED(NULL()) was causing an internal check of the compiler to fail.
I fixed this by changing the entry for "ASSOCIATED" i
[flang] Failed call to CHECK() for call to ASSOCIATED(NULL())
Calling "ASSOCATED(NULL()) was causing an internal check of the compiler to fail.
I fixed this by changing the entry for "ASSOCIATED" in the intrinsics table to accept "AnyPointer" which contains a new "KindCode" of "pointerType". I also changed the function "FromActual()" to return a typeless intrinsic when called on a pointer, which duplicates its behavior for BOZ literals. This required changing the analysis of procedure arguments. While testing processing for procedure arguments, I found another bad call to `CHECK()` which I fixed.
I made several other changes: -- I implemented constant folding for ASSOCIATED(). -- I fixed handling of NULL() in relational operations. -- I implemented semantic analysis for ASSOCIATED(). -- I noticed that the semantics for ASSOCIATED() are similar to those for pointer assignment. So I extracted the code that pointer assignment uses for procedure pointer compatibility to a place where it could be used by the semantic analysis for ASSOCIATED(). -- I couldn't figure out how to make the general semantic analysis for procedure arguments work with ASSOCIATED()'s second argument, which can be either a pointer or a target. So I stopped using normal semantic analysis for arguments for ASSOCIATED(). -- I added tests for all of this.
Differential Revision: https://reviews.llvm.org/D88313
show more ...
|
#
37b2e2b0 |
| 30-Sep-2020 |
peter klausler <pklausler@nvidia.com> |
[flang] Semantic analysis for FINAL subroutines
Represent FINAL subroutines in the symbol table entries of derived types. Enforce constraints. Update tests that have inadvertent violations or modi
[flang] Semantic analysis for FINAL subroutines
Represent FINAL subroutines in the symbol table entries of derived types. Enforce constraints. Update tests that have inadvertent violations or modified messages. Added a test.
The specific procedure distinguishability checking code for generics was used to enforce distinguishability of FINAL procedures. (Also cleaned up some confusion and redundancy noticed in the type compatibility infrastructure while digging into that area.)
Differential revision: https://reviews.llvm.org/D88613
show more ...
|
Revision tags: llvmorg-11.0.0-rc3 |
|
#
f862d858 |
| 31-Aug-2020 |
peter klausler <pklausler@nvidia.com> |
[flang] Check shape conformance on initializers
Specifically, ensure that initializers conform with their objects according to 8.2 para 4.
Differential Revision: https://reviews.llvm.org/D86886
|
Revision tags: llvmorg-11.0.0-rc2 |
|
#
0e9e06a6 |
| 06-Aug-2020 |
peter klausler <pklausler@nvidia.com> |
[flang][NFC] Reformat files with current clang-format
Differential Revision: https://reviews.llvm.org/D85489
|
Revision tags: llvmorg-11.0.0-rc1, llvmorg-12-init, llvmorg-10.0.1, llvmorg-10.0.1-rc4, llvmorg-10.0.1-rc3, llvmorg-10.0.1-rc2 |
|
#
4171f80d |
| 19-Jun-2020 |
peter klausler <pklausler@nvidia.com> |
[flang] DATA stmt processing (part 3/4): Remaining prep work
Rolls up small changes across the frontend to prepare for the large forthcoming patch (part 4/4) that completes DATA statement processing
[flang] DATA stmt processing (part 3/4): Remaining prep work
Rolls up small changes across the frontend to prepare for the large forthcoming patch (part 4/4) that completes DATA statement processing via conversion to initializers.
Reviewed By: PeteSteinfeld
Differential Revision: https://reviews.llvm.org/D82137
show more ...
|
Revision tags: llvmorg-10.0.1-rc1 |
|
#
b98ad941 |
| 09-Apr-2020 |
David Truby <david.truby@arm.com> |
[flang] Merge flang-compiler/f18
This is the initial merge of flang-compiler, which is done in this way principally to preserve the history and git-blame, without generating a large number of commit
[flang] Merge flang-compiler/f18
This is the initial merge of flang-compiler, which is done in this way principally to preserve the history and git-blame, without generating a large number of commits on the first-parent history of LLVM.
If you don't care about the flang history during a bisect remember that you can supply paths to git-bisect, e.g. `git bisect start clang llvm`.
The history of f18 was rewritten to:
* Put the code under /flang/. * Linearize the history. * Rewrite commit messages so that issue and PR numbers point to the old repository.
Credit to Peter Waller for writing the flatten and merge script.
Updates: flang-compiler/f18#876 (submission into llvm-project) Mailing-list: http://lists.llvm.org/pipermail/llvm-dev/2020-January/137989.html ([llvm-dev] Flang landing in the monorepo - next Monday!) Mailing-list: http://lists.llvm.org/pipermail/llvm-dev/2019-December/137661.html ([llvm-dev] Flang landing in the monorepo)
Co-authored-by: Peter Waller <peter.waller@arm.com>
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
|
Revision tags: llvmorg-10.0.0, llvmorg-10.0.0-rc6, llvmorg-10.0.0-rc5, llvmorg-10.0.0-rc4, llvmorg-10.0.0-rc3 |
|
#
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 ...
|
#
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 ...
|