PPeter Klausler[flang] Fold calls to ISHFTC()
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
[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 | 4 年前 | |
[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 | 4 年前 | |
Bitwise comparison intrinsics This patch implements lowering for the F08 bitwise comparison intrinsics (BGE, BGT, BLE and BLT). This does not create any runtime functions since the functionality is simple enough to carry out in IR. The existing semantic check has been changed because it unconditionally converted the arguments to the largest possible integer type. This resulted in the argument with the smaller bit-size being sign-extended. However, the standard requires the argument with the smaller bit-size to be zero-extended. Reviewed By: klausler, jeanPerier Differential Revision: https://reviews.llvm.org/D127805 | 3 年前 | |
[flang] Fold BTEST Implements constant folding for BTEST intrinsic function. Differential Revision: https://reviews.llvm.org/D111849 | 4 年前 | |
[flang] Fold LGE/LGT/LLE/LLT intrinsic functions Fold the legacy intrinsic functions LGE, LGT, LLE, & LLT by rewriting them into character relational expressions and then folding those. Also fix folding of comparisons of character values of distinct lengths: the shorter value must be padded with blanks. (This fix exposed some bad test cases, which are also fixed.) Differential Revision: https://reviews.llvm.org/D111843 | 4 年前 | |
[flang][Evaluate] Fold DBLE We can reuse the folding of REAL. Differential Revision: https://reviews.llvm.org/D122214 | 4 年前 | |
[flang] Fold real-valued DIM() Fold references to the intrinsic function DIM with constant real arguments. And clean up folding of comparisons with NaNs to address a problem noticed in testing -- NaNs should successfully compare unequal to all values, including themselves, instead of failing all comparisons. Differential Revision: https://reviews.llvm.org/D125146 | 4 年前 | |
[flang][NFC] Test folding of F08 shift intrinsics Test compile-time folding of F08 shift (shiftl, shiftr, shifta) and combined shift (dshiftl, dshiftr) intrinsics. Differential Revision: https://reviews.llvm.org/D129696 | 3 年前 | |
[flang] Support FINDLOC/MAXLOC/MINLOC with scalar mask Previously MASK= elements were accessed in assumption that mask is an array of input argument rank (and in combination with explicit DIM= argument we had out-of-bounds access), but for MAXLOC/MINLOC/FINDLOC mask should be be conformable and could be scalar. Add new regression tests with scalar mask for verification. Reviewed By: klausler Differential Revision: https://reviews.llvm.org/D124408 | 4 年前 | |
[flang] Fold IBITS() intrinsic function Implement constant folding of IBITS(); add test. Differential Revision: https://reviews.llvm.org/D123707 | 4 年前 | |
[flang] Fix bogus folding error for ISHFT(x, negative) Negative shift counts are of course valid for ISHFT when shifting to the right. This patch decouples the folding of ISHFT from that of SHIFTA/L/R and adds tests. Differential Revision: https://reviews.llvm.org/D112244 | 4 年前 | |
[flang] Fold calls to ISHFTC() The integer arithmetic template supports ISHFTC() but the integer intrinsic folding code had yet to call it; finish the job. Differential Revision: https://reviews.llvm.org/D130379 | 3 年前 | |
[flang][NFC] Test folding F08 mask intrinsics Test compile-time folding of F08 maskl and maskr intrinsics. Differential Revision: https://reviews.llvm.org/D129663 | 3 年前 | |
[flang][NFC] Test folding of F08 merge_bits intrinsic. Test compile-time folding of the F2008 merge_bits intrinsic. Differential Revision: https://reviews.llvm.org/D129780 | 3 年前 | |
[flang] Cope with overflow in real MOD/MODULO In folding and in the runtime library for real MOD/MODULO(A,P), detect overflow from the division A/P and return a properly signed zero result. (When A/P overflows and both A and P are finite numbers with nonzero P, the quotient would be a large integer when rounded to the precision of the floating-point representation.) Differential Revision: https://reviews.llvm.org/D129020 | 3 年前 | |
[flang] Fold NEAREST() and its relatives Implement constant folding for the intrinsic function NEAREST() and the related functions IEEE_NEXT_AFTER(), IEEE_NEXT_UP(), and IEEE_NEXT_DOWN(). Differential Revision: https://reviews.llvm.org/D122510 | 4 年前 | |
[flang][nfc] Test folding of bit-population count intrinsics Test compile-time folding of the leadz, trailz, popcnt and poppar Fortran 2008 intrinsics. Differential Revision: https://reviews.llvm.org/D129610 | 3 年前 | |
[flang] Fold complex component references Complex component references (z%RE, z%IM) of complex named constants should be evaluated at compilation time. Differential Revision: https://reviews.llvm.org/D125341 | 4 年前 | |
[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 | 4 年前 | |
[flang][NFC] Test folding of F08 shift intrinsics Test compile-time folding of F08 shift (shiftl, shiftr, shifta) and combined shift (dshiftl, dshiftr) intrinsics. Differential Revision: https://reviews.llvm.org/D129696 | 3 年前 | |
[flang] Fold intrinsic functions SPACING() and RRSPACING() The related real number system inquiry functions SPACING() and RRSPACING() can be folded for constant arguments. See 16.9.164 & 16.9.180 in Fortran 2018. Differential Revision: https://reviews.llvm.org/D125100 | 4 年前 | |
[flang] Correct folding of SPREAD() for higher ranks The construction of the dimension order vector used to populate the result array was incorrect, leading to a scrambled-looking result for rank-3 and higher results. Fix, and extend tests. Differential Revision: https://reviews.llvm.org/D125113 | 4 年前 | |
[flasg] Debug folding of substring references Character substrings weren't being folded correctly; add tests and rework the implementation so that substrings of literals and named constant character scalars & arrays are properly folded for use in constant expressions. Differential Revision: https://reviews.llvm.org/D117343 | 4 年前 | |
[flang] Correct folding of TRANSFER(integer, character array) The code that copies data from a constant source array into a character array constant result was failing to copy its last element if it was only partially defined due to misalignment. Differential Revision: https://reviews.llvm.org/D130376 | 3 年前 | |
[flang] Fold intrinsic inquiry functions SAME_TYPE_AS() and EXTENDS_TYPE_OF() When the result can be known at compilation time, fold it. Success depends on whether the operands are polymorphic. When neither one is polymorphic, the result is known and can be either .TRUE. or .FALSE.; when either one is polymorphic, a .FALSE. result still can be discerned. Differential Revision: https://reviews.llvm.org/D125062 | 4 年前 | |
[flang] Fix usage & catch errors for MAX/MIN with keyword= arguments Max(), MIN(), and their specific variants are defined with an unlimited number of dummy arguments named A1=, A2=, &c. whose names are almost never used in practice but should be allowed for and properly checked for the usual errors when they do appear. The intrinsic table's entries otherwise have fixed numbers of dummy argument definitions, so add some special case handling in a few spots for MAX/MIN/&c. checking and procedure characteristics construction. Differential Revision: https://reviews.llvm.org/D114750 | 4 年前 | |
[flang] Operands of SIGN() need not have same kind The standard requires that the operands of the intrinsic function SIGN() must have the same type (INTEGER or REAL), but they are not required to have the same kind. Differential Revision: https://reviews.llvm.org/D125105 | 4 年前 | |
[flang] Fold real-valued DIM() Fold references to the intrinsic function DIM with constant real arguments. And clean up folding of comparisons with NaNs to address a problem noticed in testing -- NaNs should successfully compare unequal to all values, including themselves, instead of failing all comparisons. Differential Revision: https://reviews.llvm.org/D125146 | 4 年前 | |
[flang] Fold real-valued MODULO() and MOD() Evaluate real-valued references to the intrinsic functions MODULO and MOD at compilation time without recourse to an external math library. Differential Revision: https://reviews.llvm.org/D125151 | 4 年前 | |
[flang] Accept INDEX(..., BACK=array) The intrinsic table entry for INDEX mistakenly required the optional BACK= argument to be scalar, but it's an elemental intrinsic that can accept a conforming array. Differential Revision: https://reviews.llvm.org/D117700 | 4 年前 | |
[flang] Fix ORDER= argument to RESHAPE The ORDER= argument to the transformational intrinsic function RESHAPE was being misinterpreted in an inverted way that could be detected only with 3-d or higher rank array. Fix in both folding and the runtime, and extend tests. Differential Revision: https://reviews.llvm.org/D113699 | 4 年前 | |
[flang] Fold SET_EXPONENT() and FRACTION() Fold the intrinsic function SET_EXPONENT() and its special case, FRACTION(). Differential Revision: https://reviews.llvm.org/D130378 | 3 年前 | |
[flang] Fix UBOUND() constant folding for parentheses expr Similarly to LBOUND((x)) in https://reviews.llvm.org/D123838 - fix UBOUND((x)) folding for constant arrays to return shape instead of recurse scan. Depends on D123520 Reviewed By: jeanPerier Differential Revision: https://reviews.llvm.org/D123944 | 4 年前 | |
[flang] Return true in IsSymplyContiguous for allocatables The current code was relying on the fact that allocatables are deferred shape and that isAssumedShape() should therefore return true for them. This is not true, because the current parsing/semantic analysis always builds a semantics::ArraySpec for x(:) that returns true to both isDeferredShape()/isAssumedShape(), whether x is allocatable/pointer or not. It proved tricky to change this behavior, so this is a simple fix for IsSymplyContiguous where it currently matters, but we most likely want to investigate more and fix the isDeferredShape()/isAssumedShape() in a second time. Differential Revision: https://reviews.llvm.org/D114599 | 4 年前 | |
[flang] Fold TRANSFER() Fold usage of the raw data reinterpretation intrinsic function TRANSFER(). Differential Revision: https://reviews.llvm.org/D129671 | 3 年前 | |
[Flang] Port test_folding.sh to Python To enable Flang testing on Windows, shells scripts have to be ported to Python. The following changes have been made: Ported test_folding.sh to Python; Additional changes to the tests themselves to use the new script. LIBPGMATH support for testing not available at this point. Reviewed By: Meinersbur Differential Revision: https://reviews.llvm.org/D108217 | 4 年前 | |
[Flang] Port test_folding.sh to Python To enable Flang testing on Windows, shells scripts have to be ported to Python. The following changes have been made: Ported test_folding.sh to Python; Additional changes to the tests themselves to use the new script. LIBPGMATH support for testing not available at this point. Reviewed By: Meinersbur Differential Revision: https://reviews.llvm.org/D108217 | 4 年前 | |
[Flang] Port test_folding.sh to Python To enable Flang testing on Windows, shells scripts have to be ported to Python. The following changes have been made: Ported test_folding.sh to Python; Additional changes to the tests themselves to use the new script. LIBPGMATH support for testing not available at this point. Reviewed By: Meinersbur Differential Revision: https://reviews.llvm.org/D108217 | 4 年前 | |
[flang] Distinguish usage and portability warning messages Using recently established message severity codes, upgrade non-fatal messages to usage and portability warnings as appropriate. Differential Revision: https://reviews.llvm.org/D121246 | 4 年前 | |
[Flang] Port test_folding.sh to Python To enable Flang testing on Windows, shells scripts have to be ported to Python. The following changes have been made: Ported test_folding.sh to Python; Additional changes to the tests themselves to use the new script. LIBPGMATH support for testing not available at this point. Reviewed By: Meinersbur Differential Revision: https://reviews.llvm.org/D108217 | 4 年前 | |
[flang] Set LBOUND() folding for (x) expression as ones Set LBOUND() constant folding for parentheses expr. as ones Array bounds should not propagate throught omitted bounds specifications or temporary variables - fix constant folding in case of Parentheses<T> expression by explicitly returning array of ones (or scalar in case of DIM=). Add set of tests for (x) bounds checks (w/ and w/o 'parameter' arrays) Reviewed By: jeanPerier Differential Revision: https://reviews.llvm.org/D123838 | 4 年前 | |
[Flang] Port test_folding.sh to Python To enable Flang testing on Windows, shells scripts have to be ported to Python. The following changes have been made: Ported test_folding.sh to Python; Additional changes to the tests themselves to use the new script. LIBPGMATH support for testing not available at this point. Reviewed By: Meinersbur Differential Revision: https://reviews.llvm.org/D108217 | 4 年前 | |
[Flang] Port test_folding.sh to Python To enable Flang testing on Windows, shells scripts have to be ported to Python. The following changes have been made: Ported test_folding.sh to Python; Additional changes to the tests themselves to use the new script. LIBPGMATH support for testing not available at this point. Reviewed By: Meinersbur Differential Revision: https://reviews.llvm.org/D108217 | 4 年前 | |
[Flang] Port test_folding.sh to Python To enable Flang testing on Windows, shells scripts have to be ported to Python. The following changes have been made: Ported test_folding.sh to Python; Additional changes to the tests themselves to use the new script. LIBPGMATH support for testing not available at this point. Reviewed By: Meinersbur Differential Revision: https://reviews.llvm.org/D108217 | 4 年前 | |
[Flang] Port test_folding.sh to Python To enable Flang testing on Windows, shells scripts have to be ported to Python. The following changes have been made: Ported test_folding.sh to Python; Additional changes to the tests themselves to use the new script. LIBPGMATH support for testing not available at this point. Reviewed By: Meinersbur Differential Revision: https://reviews.llvm.org/D108217 | 4 年前 | |
[Flang] Port test_folding.sh to Python To enable Flang testing on Windows, shells scripts have to be ported to Python. The following changes have been made: Ported test_folding.sh to Python; Additional changes to the tests themselves to use the new script. LIBPGMATH support for testing not available at this point. Reviewed By: Meinersbur Differential Revision: https://reviews.llvm.org/D108217 | 4 年前 | |
[flang] Correct folding of CSHIFT and EOSHIFT for DIM>1 The algorithm was wrong for higher dimensions, and so were the expected test results. Rework. Differential Revision: https://reviews.llvm.org/D127018 | 3 年前 | |
[Flang] Port test_folding.sh to Python To enable Flang testing on Windows, shells scripts have to be ported to Python. The following changes have been made: Ported test_folding.sh to Python; Additional changes to the tests themselves to use the new script. LIBPGMATH support for testing not available at this point. Reviewed By: Meinersbur Differential Revision: https://reviews.llvm.org/D108217 | 4 年前 | |
[Flang] Port test_folding.sh to Python To enable Flang testing on Windows, shells scripts have to be ported to Python. The following changes have been made: Ported test_folding.sh to Python; Additional changes to the tests themselves to use the new script. LIBPGMATH support for testing not available at this point. Reviewed By: Meinersbur Differential Revision: https://reviews.llvm.org/D108217 | 4 年前 | |
[Flang] Port test_folding.sh to Python To enable Flang testing on Windows, shells scripts have to be ported to Python. The following changes have been made: Ported test_folding.sh to Python; Additional changes to the tests themselves to use the new script. LIBPGMATH support for testing not available at this point. Reviewed By: Meinersbur Differential Revision: https://reviews.llvm.org/D108217 | 4 年前 | |
[flang] Correct folding of CSHIFT and EOSHIFT for DIM>1 The algorithm was wrong for higher dimensions, and so were the expected test results. Rework. Differential Revision: https://reviews.llvm.org/D127018 | 3 年前 | |
[flang] Make SQRT folding exact Replace the latter half of the SQRT() folding algorithm with code that calculates an exact root with extra rounding bits, and then lets the usual normalization and rounding code do the right thing. Extend tests to catch regressions. Differential Revision: https://reviews.llvm.org/D128395 | 3 年前 | |
[flang] Fold COUNT() Complete folding of the intrinsic reduction function COUNT() for all cases, including partial reductions with DIM= arguments. Differential Revision: https://reviews.llvm.org/D109911 | 4 年前 | |
[flang] Fix folding of ac-implied-do indices in structure c'tors Array constructors with implied DO loops that oversee structure constructors were being prematurely folded into invalid constants containing symbolic references to the ac-implied-do indices, because they are indeed "constant expressions" as that term is used in the Fortran standard and implemented as IsConstantExpr(). What's actually needed in structure constructor folding is a test for actual constant values, which is what results from folding them later with repetition in the context of folding an ac-implied-do. Differential Revision: https://reviews.llvm.org/D115470 | 4 年前 | |
[flang] Fix folding of LEN(f(...)) LEN(f(...)), where "f" is a non-intrinsic function, should not be folded to anything else unless the result is a known constant value. While there are conceivable cases in which we could do better (e.g., an internal function whose length is a host-associated INTENT(IN) dummy argument), there are other cases that we're getting wrong. Differential Revision: https://reviews.llvm.org/D128759 | 3 年前 | |
[flang] Fix parsing and semantics for array element substring%KIND/%LEN A type-param-inquiry of %KIND or %LEN applies to a designator, and so must also be allowed for a substring. F18 presently (mis)parses instances of a type-param-inquiry as structure component references and then fixes them in expression semantics when types are known and we can distinguish them. But when the base of a type-param-inquiry is a substring of an array element, as in "charArray(i)(j:k)%len", parsing fails. Adjust the grammar to parse these cases, and extend expression semantics to process the new production. Differential Revision: https://reviews.llvm.org/D130375 | 3 年前 | |
[Flang] Port test_folding.sh to Python To enable Flang testing on Windows, shells scripts have to be ported to Python. The following changes have been made: Ported test_folding.sh to Python; Additional changes to the tests themselves to use the new script. LIBPGMATH support for testing not available at this point. Reviewed By: Meinersbur Differential Revision: https://reviews.llvm.org/D108217 | 4 年前 |