#
0f973ac7 |
| 02-Oct-2024 |
Peter Klausler <pklausler@nvidia.com> |
[flang] Tag warnings with LanguageFeature or UsageWarning (#110304)
(This is a big patch, but it's nearly an NFC. No test results have
changed and all Fortran tests in the LLVM test suites work as
[flang] Tag warnings with LanguageFeature or UsageWarning (#110304)
(This is a big patch, but it's nearly an NFC. No test results have
changed and all Fortran tests in the LLVM test suites work as expected.)
Allow a parser::Message for a warning to be marked with the
common::LanguageFeature or common::UsageWarning that controls it. This
will allow a later patch to add hooks whereby a driver will be able to
decorate warning messages with the names of its options that enable each
particular warning, and to add hooks whereby a driver can map those
enumerators by name to command-line options that enable/disable the
language feature and enable/disable the messages.
The default settings in the constructor for LanguageFeatureControl were
moved from its header file into its C++ source file.
Hooks for a driver to use to map the name of a feature or warning to its
enumerator were also added.
To simplify the tagging of warnings with their corresponding language
feature or usage warning, to ensure that they are properly controlled by
ShouldWarn(), and to ensure that warnings never issue at code sites in
module files, two new Warn() member function templates were added to
SemanticsContext and other contextual frameworks. Warn() can't be used
before source locations can be mapped to scopes, but the bulk of
existing code blocks testing ShouldWarn() and FindModuleFile() before
calling Say() were convertible into calls to Warn(). The ones that were
not convertible were extended with explicit calls to
Message::set_languageFeature() and set_usageWarning().
show more ...
|
#
6f7e715e |
| 30-Jul-2024 |
Peter Klausler <35819229+klausler@users.noreply.github.com> |
[flang] Don't inject possibly invalid conversions while folding (#100842)
A couple of intrinsic functions have optional arguments. Don't insert
type conversions on those arguments when the actual a
[flang] Don't inject possibly invalid conversions while folding (#100842)
A couple of intrinsic functions have optional arguments. Don't insert
type conversions on those arguments when the actual arguments may not be
present at execution time, due to being OPTIONAL, allocatables, or
pointers.
show more ...
|
#
505f6da1 |
| 01-May-2024 |
Peter Klausler <35819229+klausler@users.noreply.github.com> |
[flang] Ensure all warning/portability messages are guarded by Should… (#90518)
…Warn()
Many warning messages were being emitted unconditionally. Ensure that
all warnings are conditional on a tr
[flang] Ensure all warning/portability messages are guarded by Should… (#90518)
…Warn()
Many warning messages were being emitted unconditionally. Ensure that
all warnings are conditional on a true result from a call to
common::LanguageFeatureControl::ShouldWarn() so that it is easy for a
driver to disable them all, or, in the future, to provide per-warning
control over them.
show more ...
|
#
82e1e412 |
| 15-Jan-2024 |
Peter Klausler <35819229+klausler@users.noreply.github.com> |
[flang][runtime] Treatment of NaN in MAXVAL/MAXLOC/MINVAL/MINLOC (#76999)
Detect NaN elements in data and handle them like gfortran does (at
runtime); namely, NaN can be returned if all the data ar
[flang][runtime] Treatment of NaN in MAXVAL/MAXLOC/MINVAL/MINLOC (#76999)
Detect NaN elements in data and handle them like gfortran does (at
runtime); namely, NaN can be returned if all the data are NaNs, but any
non-NaN value is preferable. Ensure that folding returns the same
results as runtime computation.
Fixes llvm-test-suite/Fortran/gfortran/regression/maxloc_2.f90 (and
probably others).
show more ...
|
#
8926f0fe |
| 04-Aug-2023 |
Peter Klausler <pklausler@nvidia.com> |
[flang] Fold MERGE() of derived type values
Generalize FoldMerge() to accommodate derived type arguments and results, rename it into Folder<T>::MERGE(), and remove it from the various FoldIntrinsicF
[flang] Fold MERGE() of derived type values
Generalize FoldMerge() to accommodate derived type arguments and results, rename it into Folder<T>::MERGE(), and remove it from the various FoldIntrinsicFunction() routines for intrinsic types.
Fixes llvm-test-suite/Fortran/gfortran/regression/merge_init_expr_2.f90.
Differential Revision: https://reviews.llvm.org/D157345
show more ...
|
#
541f5c4a |
| 01-Jun-2023 |
Hussain Kadhem <hmk@berkeley.edu> |
Flang implementation for COMPILER_VERSION and COMPILER_OPTIONS intrinsics
This revision implements the Fortran intrinsic procedures COMPILER_VERSION and COMPILER_OPTIONS from the iso_fortran_env mod
Flang implementation for COMPILER_VERSION and COMPILER_OPTIONS intrinsics
This revision implements the Fortran intrinsic procedures COMPILER_VERSION and COMPILER_OPTIONS from the iso_fortran_env module. To be able to set the COMPILER_OPTIONS string according to the original compiler driver invocation, a string is passed to the frontend driver using the environment variable FLANG_COMPILER_OPTIONS_STRING, for lack of a better mechanism.
Fixes #59233
Reviewed By: awarzynski
Differential Revision: https://reviews.llvm.org/D140524
show more ...
|
#
8151d6f8 |
| 07-Feb-2023 |
Peter Klausler <pklausler@nvidia.com> |
[flang] Diagnose REPEAT with negative NCOPIES=
Emit an error when the NCOPIES= argument to the intrinsic function REPEAT has a negative value. (The current implementation crashes, which isn't infor
[flang] Diagnose REPEAT with negative NCOPIES=
Emit an error when the NCOPIES= argument to the intrinsic function REPEAT has a negative value. (The current implementation crashes, which isn't informative.)
Differential Revision: https://reviews.llvm.org/D143820
show more ...
|
#
23f258ce |
| 17-Jan-2023 |
Peter Klausler <pklausler@nvidia.com> |
[flang] Don't fold REPEAT() when the result would be too large
A test program shouldn't be able to crash the compiler by getting it to fold REPEAT() with an absurdly large repetition count.
Differe
[flang] Don't fold REPEAT() when the result would be too large
A test program shouldn't be able to crash the compiler by getting it to fold REPEAT() with an absurdly large repetition count.
Differential Revision: https://reviews.llvm.org/D142770
show more ...
|
#
73eb5dbd |
| 03-Jan-2023 |
Peter Klausler <pklausler@nvidia.com> |
[flang] Catch out-of-range constant arguments to CHAR/ACHAR
When folding the intrinsic functions CHAR and ACHAR, emit an error message if the argument is out of the valid range for the kind of the r
[flang] Catch out-of-range constant arguments to CHAR/ACHAR
When folding the intrinsic functions CHAR and ACHAR, emit an error message if the argument is out of the valid range for the kind of the result.
Differential Revision: https://reviews.llvm.org/D142754
show more ...
|
#
ae93d8ea |
| 05-Jul-2022 |
Peter Klausler <pklausler@nvidia.com> |
[flang] Fold TRANSFER()
Fold usage of the raw data reinterpretation intrinsic function TRANSFER().
Differential Revision: https://reviews.llvm.org/D129671
|
#
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 ...
|
#
cc1d13f9 |
| 29-Sep-2021 |
peter klausler <pklausler@nvidia.com> |
[flang] Fold MAXLOC and MINLOC
Generalize the code that folds FINDLOC to also handle folding for MAXLOC and MINLOC.
Differential Revision: https://reviews.llvm.org/D110951
|
#
82568675 |
| 28-Sep-2021 |
Peter Klausler <pklausler@nvidia.com> |
[flang] Fold FINDLOC()
Fold the transformational intrinsic function FINDLOC() for all combinations of optional arguments and data types.
Differential Revision: https://reviews.llvm.org/D110757
|
#
0bbb2d00 |
| 07-Jul-2021 |
peter klausler <pklausler@nvidia.com> |
[flang] Fold CSHIFT
Implement folding of the transformational intrinsic function CSHIFT for all types.
Differential Revision: https://reviews.llvm.org/D108931
|
#
503c085e |
| 18-Jun-2021 |
peter klausler <pklausler@nvidia.com> |
[flang] Fold more reduction intrinsic function calls
Refactor the recently-implemented MAXVAL/MINVAL folding so that the parts that can be used to implement other reduction transformational intrinsi
[flang] Fold more reduction intrinsic function calls
Refactor the recently-implemented MAXVAL/MINVAL folding so that the parts that can be used to implement other reduction transformational intrinsic function folding are exposed.
Use them to implement folding of IALL, IANY, IPARITY, SUM. and PRODUCT. Replace the folding of ALL & ANY to use the new infrastructure and become able to handle DIM= arguments.
Differential Revision: https://reviews.llvm.org/D104562
show more ...
|
#
fc4f457f |
| 16-Jun-2021 |
peter klausler <pklausler@nvidia.com> |
[flang] Fix ARM/POWER test failure (folding20.f90)
Recent code for folding MINVAL() didn't allow for architectures whose C/C++ char type is unsigned, so the value of the maximum Fortran character wa
[flang] Fix ARM/POWER test failure (folding20.f90)
Recent code for folding MINVAL() didn't allow for architectures whose C/C++ char type is unsigned, so the value of the maximum Fortran character was incorrect. This was caught by the folding20.f90 test. The fix is to avoid numeric_limits<> and use hard values for max signed integers of various character kinds.
Pushing into llvm-project/main to restore ARM/POWER buildbots.
show more ...
|
#
47f18af5 |
| 15-Jun-2021 |
peter klausler <pklausler@nvidia.com> |
[flang] Fold MAXVAL & MINVAL
Implement constant folding for the reduction transformational intrinsic functions MAXVAL and MINVAL.
In anticipation of more folding work to follow, with (I hope) some
[flang] Fold MAXVAL & MINVAL
Implement constant folding for the reduction transformational intrinsic functions MAXVAL and MINVAL.
In anticipation of more folding work to follow, with (I hope) some common infrastructure, these two have been implemented in a new header file.
Differential Revision: https://reviews.llvm.org/D104337
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
|
#
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 ...
|