Tim Keith [Fri, 29 Mar 2019 22:04:17 +0000 (15:04 -0700)]
[flang] Rework .mod file writing for subprogram interfaces
A subprogram interface in a `.mod` file requires all of the symbols
needed to declare the function return value and dummy arguments.
Some of those were missing.
`SubprogramSymbolCollector` recursively discovers all such symbols,
including symbols used in type parameters, array bounds, character
lengths, parent types.
Common blocks require special handling: If any of the symbols that
are need appear in a common block, we have to include that common block
and all other symbols in it. To make that easier to figure out, add the
`commonBlock` property to `ObjectEntityDetails` to map the entity to
the common block it is in, if any.
Original-commit: flang-compiler/f18@
08709f8e88c3b37bdf8461f34340dc345dfbb085
Reviewed-on: https://github.com/flang-compiler/f18/pull/368
Tree-same-pre-rewrite: false
Tim Keith [Tue, 19 Mar 2019 22:30:25 +0000 (15:30 -0700)]
[flang] Resolve LHS in pointer assignment
Original-commit: flang-compiler/f18@
9a3525275cb8b25c6be80635a40d182b73042ea4
Reviewed-on: https://github.com/flang-compiler/f18/pull/368
Tree-same-pre-rewrite: false
Tim Keith [Wed, 20 Mar 2019 20:52:33 +0000 (13:52 -0700)]
[flang] Dump function return attributes
Also, change SubprogramDetails::result_ from `std::optional<Symbol *>`
to `Symbol *`. We don't need two levels of optional-ness.
Original-commit: flang-compiler/f18@
db3b874946dc9b139009d7e10832edb2a076a7bc
Reviewed-on: https://github.com/flang-compiler/f18/pull/368
Tree-same-pre-rewrite: false
Tim Keith [Thu, 21 Mar 2019 00:00:26 +0000 (17:00 -0700)]
[flang] Don't add inherited procedures to generic binding
In this example:
```
type t1
contains
procedure, nopass :: s1
generic :: foo => s1
end type
type, extends(t1) :: t2
contains
procedure, nopass :: s2
generic :: foo => s2
end type
```
The GenericBindingDetails for foo in t2 include both s1 and s2 as
specific procs. There is no way to distinguish between the binding in
the current type and the binding that was inherited. In particular,
the .mod file will have a binding for s1 in t2, so it won't match the
original source (for exampke, see the old version of modfile14.f90).
Original-commit: flang-compiler/f18@
4e2c6be5cbdc5d31c41f0e44b85985b4fb69210d
Reviewed-on: https://github.com/flang-compiler/f18/pull/368
Tree-same-pre-rewrite: false
Peter Klausler [Tue, 2 Apr 2019 16:26:05 +0000 (09:26 -0700)]
[flang] Merge pull request flang-compiler/f18#370 from flang-compiler/pmk-fix363
Fix flang-compiler/f18#363: Adjust member function names in integer.h to avoid confusion.
Original-commit: flang-compiler/f18@
bdd750f742eafde96054e438731137e80673d5aa
Reviewed-on: https://github.com/flang-compiler/f18/pull/370
peter klausler [Mon, 1 Apr 2019 17:43:42 +0000 (10:43 -0700)]
[flang] Adjust member function names in integer.h to avoid confusion.
Original-commit: flang-compiler/f18@
56dba8fa0897294b1a6f59348938312c0dff3e7b
Reviewed-on: https://github.com/flang-compiler/f18/pull/370
Peter Klausler [Mon, 1 Apr 2019 23:49:59 +0000 (16:49 -0700)]
[flang] Merge pull request flang-compiler/f18#373 from flang-compiler/pmk-source
Fix flang-compiler/f18#358: Define and use UnlabeledStatement<> for if & forall
Original-commit: flang-compiler/f18@
7c76ba5158cdbbe4461d15ecffbf754e7172667c
Reviewed-on: https://github.com/flang-compiler/f18/pull/373
peter klausler [Mon, 1 Apr 2019 23:15:47 +0000 (16:15 -0700)]
[flang] some debugging after more testing
Original-commit: flang-compiler/f18@
005b841dd1140a809fb8123ed5b02048b8e1a4d3
Reviewed-on: https://github.com/flang-compiler/f18/pull/373
peter klausler [Mon, 1 Apr 2019 23:00:19 +0000 (16:00 -0700)]
[flang] Use source location in IF statement checks.
Original-commit: flang-compiler/f18@
9e08746e2b4487bddf2e4b3580cdea4568fa5d53
Reviewed-on: https://github.com/flang-compiler/f18/pull/373
Tree-same-pre-rewrite: false
peter klausler [Mon, 1 Apr 2019 22:57:07 +0000 (15:57 -0700)]
[flang] Fix typo
Original-commit: flang-compiler/f18@
c5b05009df4562f79fc0e219c73ec6123b9982c1
Reviewed-on: https://github.com/flang-compiler/f18/pull/373
Tree-same-pre-rewrite: false
peter klausler [Mon, 1 Apr 2019 22:55:31 +0000 (15:55 -0700)]
[flang] Fix typo
Original-commit: flang-compiler/f18@
6be309300e329487f39c546e6d07ae7dc82d1ac0
Reviewed-on: https://github.com/flang-compiler/f18/pull/373
Tree-same-pre-rewrite: false
peter klausler [Mon, 1 Apr 2019 22:52:49 +0000 (15:52 -0700)]
[flang] Define and use UnlabeledStatement<> for if & forall
Original-commit: flang-compiler/f18@
028e6aba6cd0ca40533401fcd4bab38e94f1f43a
Reviewed-on: https://github.com/flang-compiler/f18/pull/373
Tree-same-pre-rewrite: false
Tim Keith [Mon, 1 Apr 2019 23:21:44 +0000 (16:21 -0700)]
[flang] Merge pull request flang-compiler/f18#372 from flang-compiler/tsk3
Name resolution bug fixes
Original-commit: flang-compiler/f18@
74c994e9a5b90daedff591891d60ba83601505db
Reviewed-on: https://github.com/flang-compiler/f18/pull/372
Tim Keith [Mon, 1 Apr 2019 20:08:57 +0000 (13:08 -0700)]
[flang] Name resolution bug fixes
Fix a but where a derived type was not use-associated correctly
due to missing call to `GetUltimate()`.
Fix a bug with access statement, generic interface, and derived
type all with the same name.
Remove some TODOs that have been done.
Original-commit: flang-compiler/f18@
4ba2b64c6d291d04691891535da96f425dda2338
Reviewed-on: https://github.com/flang-compiler/f18/pull/372
Peter Klausler [Mon, 1 Apr 2019 22:20:18 +0000 (15:20 -0700)]
[flang] Merge pull request flang-compiler/f18#371 from flang-compiler/pmk-parens
Fix flang-compiler/f18#350: insert parens into formatted expressions only when required
Original-commit: flang-compiler/f18@
24fd62850cbb3e50aa8185bc61d2683e723810f8
Reviewed-on: https://github.com/flang-compiler/f18/pull/371
peter klausler [Mon, 1 Apr 2019 22:02:23 +0000 (15:02 -0700)]
[flang] Revert to AsFortran in module file output.
Original-commit: flang-compiler/f18@
3dc7f685d177788f8f13d97d7e03aa00720f4730
Reviewed-on: https://github.com/flang-compiler/f18/pull/371
peter klausler [Mon, 1 Apr 2019 20:03:26 +0000 (13:03 -0700)]
[flang] Use operator<< in test.
Original-commit: flang-compiler/f18@
e3f321e9f0a1995b82b33de2911ca8a1754b8e91
Reviewed-on: https://github.com/flang-compiler/f18/pull/371
Tree-same-pre-rewrite: false
peter klausler [Mon, 1 Apr 2019 20:01:42 +0000 (13:01 -0700)]
[flang] Logical operation precedence
Original-commit: flang-compiler/f18@
060bc39fb4f42a9ac82b05a0603d62a2bdc3cb30
Reviewed-on: https://github.com/flang-compiler/f18/pull/371
Tree-same-pre-rewrite: false
peter klausler [Mon, 1 Apr 2019 19:30:08 +0000 (12:30 -0700)]
[flang] Pass tests
Original-commit: flang-compiler/f18@
ffb057f262c63e877f5bebc9604f795804bc1042
Reviewed-on: https://github.com/flang-compiler/f18/pull/371
Tree-same-pre-rewrite: false
peter klausler [Mon, 1 Apr 2019 17:54:22 +0000 (10:54 -0700)]
[flang] work in progress
Original-commit: flang-compiler/f18@
33ea8e506a114350d4c587ed14c6f5dacbd5379a
Reviewed-on: https://github.com/flang-compiler/f18/pull/371
Tree-same-pre-rewrite: false
peter klausler [Wed, 27 Mar 2019 22:27:33 +0000 (15:27 -0700)]
[flang] Move some AsFortran() implementations into new formatting.cc; use precedence for parentheses
Original-commit: flang-compiler/f18@
2b5fa051df3c8e183349388181e66e085385396e
Reviewed-on: https://github.com/flang-compiler/f18/pull/371
Tree-same-pre-rewrite: false
Peter Klausler [Mon, 1 Apr 2019 17:49:45 +0000 (10:49 -0700)]
[flang] Merge pull request flang-compiler/f18#352 from flang-compiler/pmk-parsing
Fix some parsing issues found by Steve
Original-commit: flang-compiler/f18@
683766f7f512f5ea5d9b4c15ea71c6d82aada93c
Reviewed-on: https://github.com/flang-compiler/f18/pull/352
peter klausler [Fri, 22 Mar 2019 23:37:17 +0000 (16:37 -0700)]
[flang] Add extension edit descriptors to the unparser.
Original-commit: flang-compiler/f18@
74e09e249a0e99059cd4d0fd89deadd2bc82b5a0
Reviewed-on: https://github.com/flang-compiler/f18/pull/352
peter klausler [Fri, 22 Mar 2019 22:08:16 +0000 (15:08 -0700)]
[flang] Support CONVERT= and DISPOSE= on INQUIRE
Original-commit: flang-compiler/f18@
fbedd32376eb71d289177cfe127d1d4835a51a61
Reviewed-on: https://github.com/flang-compiler/f18/pull/352
Tree-same-pre-rewrite: false
peter klausler [Fri, 22 Mar 2019 21:27:18 +0000 (14:27 -0700)]
[flang] Check int literals for overflow when kind is known.
improve test
Original-commit: flang-compiler/f18@
09ce783cd30e6d70829d0b5596fe8f3e0f88c64f
Reviewed-on: https://github.com/flang-compiler/f18/pull/352
Tree-same-pre-rewrite: false
peter klausler [Thu, 21 Mar 2019 23:47:51 +0000 (16:47 -0700)]
[flang] Allow dollar and backslash formats
Original-commit: flang-compiler/f18@
4d8d6e599eab130a9026c53f404a7036d4410c47
Reviewed-on: https://github.com/flang-compiler/f18/pull/352
Tree-same-pre-rewrite: false
peter klausler [Thu, 21 Mar 2019 23:29:50 +0000 (16:29 -0700)]
[flang] Allow multiple associations on legacy POINTER declaration
fix that fix
Original-commit: flang-compiler/f18@
f096b73842cc0d443517a1075b3a31dd9ed8fdca
Reviewed-on: https://github.com/flang-compiler/f18/pull/352
Tree-same-pre-rewrite: false
jeanPerier [Mon, 1 Apr 2019 08:44:51 +0000 (01:44 -0700)]
[flang] Update documentation to reflect current intrinsic procedure support in f18
Merge pull request flang-compiler/f18#366 from flang-compiler/jpr0
Original-commit: flang-compiler/f18@
0f310c8a8cf48ea61990ffa3ebcf2e15b8e7e73d
Jean Perier [Mon, 1 Apr 2019 08:39:19 +0000 (01:39 -0700)]
[flang] Address review comment
Original-commit: flang-compiler/f18@
1e3b3b457d5128b6a2419c6fac8e8e4f8a8bfb28
Jean Perier [Fri, 29 Mar 2019 15:48:39 +0000 (08:48 -0700)]
[flang] Update documentation with status of intrinsic procedure support in f18
Original-commit: flang-compiler/f18@
aa12037a5b923cbcafd04430a8436900077c6f78
Tree-same-pre-rewrite: false
Jean Perier [Fri, 29 Mar 2019 11:30:35 +0000 (04:30 -0700)]
[flang] Remove useless dummy return statements
I first added these because I had issues with return type deduction
in lambdas, but they are actually useless when the return type is
specified in the lambda signature.
Original-commit: flang-compiler/f18@
5bcbbd8bdcef2e5c34edbfa755572e74514551fe
Tree-same-pre-rewrite: false
psteinfeld [Fri, 29 Mar 2019 15:48:24 +0000 (08:48 -0700)]
[flang] Merge pull request flang-compiler/f18#365 from flang-compiler/do2
Fix semantics test for "DO".
Original-commit: flang-compiler/f18@
62794b980ec1ba1c681a84d8533fe9df5a9ea68b
Reviewed-on: https://github.com/flang-compiler/f18/pull/365
Peter Steinfeld [Fri, 29 Mar 2019 00:17:30 +0000 (17:17 -0700)]
[flang] This test fails when the directory in which test tests are run contains a path that matches the pattern "do *[1-9]". In my case, I had a directory called "do1". The "*" is not necessary in the pattern. Now the test passes unless the directory contains a " ".
Original-commit: flang-compiler/f18@
462f15e4e7c1e6a2c266700e4548f67ba9b32ca9
Reviewed-on: https://github.com/flang-compiler/f18/pull/365
jeanPerier [Fri, 29 Mar 2019 09:24:55 +0000 (02:24 -0700)]
[flang] Fix F18 scalar integer power algorithm
Merge pull request flang-compiler/f18#362 from flang-compiler/jpr1
Original-commit: flang-compiler/f18@
9f3f42fbadabfd7841478ce872fa232be601b2d2
Jean Perier [Thu, 28 Mar 2019 15:18:42 +0000 (08:18 -0700)]
[flang] Fix F18 scalar integer power algorithm
Original-commit: flang-compiler/f18@
f0609e7ace60d6272285eda9d57e4052632b0e3c
jeanPerier [Fri, 29 Mar 2019 09:24:19 +0000 (02:24 -0700)]
[flang] Fix compilation issues of PR flang-compiler/f18#292
Merge pull request flang-compiler/f18#361 from flang-compiler/jpr0
Original-commit: flang-compiler/f18@
37252adf0ec6f9968c2ff8e1f720459d89f55b6a
Jean Perier [Fri, 29 Mar 2019 08:41:26 +0000 (01:41 -0700)]
[flang] Add todo for bessel function default support
Original-commit: flang-compiler/f18@
3842e7f5acda4bb35cf6ac235250f1ba4adee504
Jean Perier [Thu, 28 Mar 2019 13:53:52 +0000 (06:53 -0700)]
[flang] Fix compilation failure on PowerPC
Original-commit: flang-compiler/f18@
f79f4973b62c378fea2de71eb002b235c53a7c28
Tree-same-pre-rewrite: false
Jean Perier [Thu, 28 Mar 2019 11:25:13 +0000 (04:25 -0700)]
[flang] Remove non standard use of bessel C functions
Original-commit: flang-compiler/f18@
a40559372a6c7476eb999ecdb2b9bee681ad4122
Tree-same-pre-rewrite: false
Jean Perier [Thu, 28 Mar 2019 09:34:32 +0000 (02:34 -0700)]
[flang] Silence GCC 8.1 spurious warning
Original-commit: flang-compiler/f18@
69e05d0632cd9722767ce4c945a614a29917ec92
Tree-same-pre-rewrite: false
Steve Scalpone [Thu, 28 Mar 2019 20:15:43 +0000 (13:15 -0700)]
[flang] Merge pull request flang-compiler/f18#364 from flang-compiler/sjs-make-install
Add CMake rules to install static and shared libraries.
Original-commit: flang-compiler/f18@
88c3b1fa128ad262b586619c2ed7cbdbdf8e3f2e
Reviewed-on: https://github.com/flang-compiler/f18/pull/364
Steve Scalpone [Thu, 28 Mar 2019 16:55:56 +0000 (09:55 -0700)]
[flang] Add CMake rules to install static and shared libraries in
the default install directory or in the directory specified
with CMAKE_INSTALL_PREFIX. Fixes flang-compiler/f18#359.
Original-commit: flang-compiler/f18@
35ce1628e24d85eb5fa8fe467af06f7a33a4d293
Reviewed-on: https://github.com/flang-compiler/f18/pull/364
Tim Keith [Thu, 28 Mar 2019 18:30:05 +0000 (11:30 -0700)]
[flang] Merge pull request flang-compiler/f18#357 from flang-compiler/tsk6
Track current statement location in SemanticsVisitor
Original-commit: flang-compiler/f18@
69575f87f2253f178b28755889a29d43193f28c5
Reviewed-on: https://github.com/flang-compiler/f18/pull/357
Tim Keith [Tue, 26 Mar 2019 19:40:13 +0000 (12:40 -0700)]
[flang] Track current statement location in SemanticsVisitor
Change `SemanticsVisitor` to track the location of the current
statement, if any, so that it's available through
`SemanticsContext::location()`
Add overloading of `SemanticsContext::Say()` that reports the
message at the location of the current statement if a `CharBlock`
is not provided.
Original-commit: flang-compiler/f18@
5185c721ee9e2da8adcc4cad5a74acc0bf5c8d2d
Reviewed-on: https://github.com/flang-compiler/f18/pull/357
Steve Scalpone [Thu, 28 Mar 2019 03:49:55 +0000 (20:49 -0700)]
[flang] Merge pull request flang-compiler/f18#360 from flang-compiler/computed-goto
Implement semantics for computed GOTO
Original-commit: flang-compiler/f18@
624623a063eda832ea8c6a543bf82d443506c7b5
Reviewed-on: https://github.com/flang-compiler/f18/pull/360
Steve Scalpone [Thu, 28 Mar 2019 03:46:51 +0000 (20:46 -0700)]
[flang] Removed unused #include files from check-computed-goto.cc.
Did the same for a few other similar files.
Original-commit: flang-compiler/f18@
6f7569b93887b32e0b18da42d655e6fde1686e31
Reviewed-on: https://github.com/flang-compiler/f18/pull/360
Steve Scalpone [Wed, 27 Mar 2019 22:48:46 +0000 (15:48 -0700)]
[flang] Fix typo: "check" becomes "checked"
Original-commit: flang-compiler/f18@
2b2b0bf324db2745200b1b82e0a286942adb0c6a
Reviewed-on: https://github.com/flang-compiler/f18/pull/360
Tree-same-pre-rewrite: false
Steve Scalpone [Wed, 27 Mar 2019 22:44:17 +0000 (15:44 -0700)]
[flang] Implement semantics for computed GOTO. Note that a PGI extension
will implicitly convert a float to integer (and issue a warning).
This commit does not implement that extension.
Original-commit: flang-compiler/f18@
b85755f26fef767850572ef5d3deea87258d87a7
Reviewed-on: https://github.com/flang-compiler/f18/pull/360
Tree-same-pre-rewrite: false
Eric Schweitz [Wed, 27 Mar 2019 23:08:33 +0000 (16:08 -0700)]
[flang] Merge pull request flang-compiler/f18#354 from schweitzpgi/master
FIR: continued development work
Original-commit: flang-compiler/f18@
60f4ef672eb1d2a7b7340df916d742d18d4454ae
Reviewed-on: https://github.com/flang-compiler/f18/pull/354
Eric Schweitz [Wed, 27 Mar 2019 17:54:14 +0000 (10:54 -0700)]
[flang] add comment per Steve's request in review
Original-commit: flang-compiler/f18@
c3a5d6a15eca27c25ba1dcd50e3a478228e98eda
Reviewed-on: https://github.com/flang-compiler/f18/pull/354
Eric Schweitz [Wed, 27 Mar 2019 15:58:59 +0000 (08:58 -0700)]
[flang] Change per Jean's review comment
Original-commit: flang-compiler/f18@
9a3a79927bbc2820706398dc2ac03f0eb1c79ad6
Reviewed-on: https://github.com/flang-compiler/f18/pull/354
Tree-same-pre-rewrite: false
Eric Schweitz [Tue, 26 Mar 2019 01:56:44 +0000 (18:56 -0700)]
[flang] remove use of undefined behavior
Original-commit: flang-compiler/f18@
d7c5879f2c86ede4304f98a4e16af6c97b2a09b9
Reviewed-on: https://github.com/flang-compiler/f18/pull/354
Tree-same-pre-rewrite: false
Eric Schweitz [Fri, 22 Mar 2019 15:21:01 +0000 (08:21 -0700)]
[flang] temporary symbol creation and improve dump routine
check for labels on construct delimiting statements
ifdef out code to avoid warning
Original-commit: flang-compiler/f18@
667674aaa08a90f65dd9f0023a157c337f749892
Reviewed-on: https://github.com/flang-compiler/f18/pull/354
Tree-same-pre-rewrite: false
Eric Schweitz [Thu, 21 Mar 2019 21:40:10 +0000 (14:40 -0700)]
[flang] remove the DO stub instructions
Original-commit: flang-compiler/f18@
f1ddcd8d76cce67aa988da8eb356c8d8d93c79a8
Reviewed-on: https://github.com/flang-compiler/f18/pull/354
Tree-same-pre-rewrite: false
Eric Schweitz [Wed, 20 Mar 2019 23:26:07 +0000 (16:26 -0700)]
[flang] build up expressions implied by DO loop construct
Original-commit: flang-compiler/f18@
1e7b9adb62666223662b5445f9303d82be432299
Reviewed-on: https://github.com/flang-compiler/f18/pull/354
Tree-same-pre-rewrite: false
Eric Schweitz [Wed, 20 Mar 2019 22:58:06 +0000 (15:58 -0700)]
[flang] simplify switch builders
Original-commit: flang-compiler/f18@
787ee1fecd275dd2b34171cd165cc38e7c46f8ba
Reviewed-on: https://github.com/flang-compiler/f18/pull/354
Tree-same-pre-rewrite: false
Eric Schweitz [Wed, 20 Mar 2019 20:01:26 +0000 (13:01 -0700)]
[flang] improved output on flat fir
Original-commit: flang-compiler/f18@
9be07963a5f70b71f4e9c38f7d89c837dbedc1a1
Reviewed-on: https://github.com/flang-compiler/f18/pull/354
Tree-same-pre-rewrite: false
Eric Schweitz [Tue, 19 Mar 2019 23:29:43 +0000 (16:29 -0700)]
[flang] refactor linear representation -> flattened
Original-commit: flang-compiler/f18@
4253e2484f15657bff75de5c22947be0c567645a
Reviewed-on: https://github.com/flang-compiler/f18/pull/354
Tree-same-pre-rewrite: false
Eric Schweitz [Tue, 19 Mar 2019 17:33:03 +0000 (10:33 -0700)]
[flang] replace GenericExprWrapper with Expr<SomeType>
Original-commit: flang-compiler/f18@
0821d00cb8b7499a7e98f4f402cf6b7ed29a825d
Reviewed-on: https://github.com/flang-compiler/f18/pull/354
Tree-same-pre-rewrite: false
Eric Schweitz [Tue, 19 Mar 2019 16:07:11 +0000 (09:07 -0700)]
[flang] FIR: more code cleanup
Original-commit: flang-compiler/f18@
eaac944aca994e64d970506c426c222d28e680b5
Reviewed-on: https://github.com/flang-compiler/f18/pull/354
Tree-same-pre-rewrite: false
jeanPerier [Wed, 27 Mar 2019 17:16:07 +0000 (10:16 -0700)]
[flang] Add abstraction layer to fold intrinsic functions with host runtime
Merge pull request flang-compiler/f18#292 from flang-compiler/jpr0
Original-commit: flang-compiler/f18@
d24de5513e6f746a539aaded6091759fa54998e4
Jean Perier [Wed, 27 Mar 2019 17:13:46 +0000 (10:13 -0700)]
[flang] Only have cmake look for libpgmath if LIBPGMATH_DIR is given
Original-commit: flang-compiler/f18@
1d778f5c1a49c2db15c1fc245ea05bb44eb13295
Jean Perier [Wed, 27 Mar 2019 15:08:12 +0000 (08:08 -0700)]
[flang] fix clang errors and warnings
Original-commit: flang-compiler/f18@
410f96384fd8d6652689956cda13147c6cd0c9f4
Tree-same-pre-rewrite: false
Jean Perier [Tue, 26 Mar 2019 17:29:46 +0000 (10:29 -0700)]
[flang] Prepare to be merged with master branch
ActualArgument was modified in the master branch from
a struct to class. In order to compile once merged, this PR
required the related access paterns to be adapted to match
the new ActualArgument.
As a consequence, this PR does not compile anymore on its own,
it needs to be merged with the master branch to work.
Original-commit: flang-compiler/f18@
48cdd2ed0ed18b9749f976257c7302e34c20b025
Tree-same-pre-rewrite: false
Jean Perier [Tue, 26 Mar 2019 17:29:22 +0000 (10:29 -0700)]
[flang] Test cases for folding intrinsic function with runtime
Original-commit: flang-compiler/f18@
92caee1def0f21b7112565de67a2ec48f326ea07
Tree-same-pre-rewrite: false
Jean Perier [Fri, 22 Mar 2019 16:22:00 +0000 (09:22 -0700)]
[flang] Enable folding of some more intrinsic functions
Enable folding of the following 80 intrinsic functions:
+ Without runtime:
++ Integer:
abs, dim, dshiftl, dshiftr, exponent, iand, ibclr, ibset, ieor, int,
ior, ishft, kind, len, leadz, maskl, maskr, merge_bits, popcnt, poppar,
shifta, shiftl, shiftr, trailz
++ Real:
abs, aimag, aint, dprod, real
+ Complex:
cmplx, conjg
++ Logical:
bge, bgt, ble, blt
+ With Runtime :
+ Real:
acos, acosh, asinh, atan, atan2, atanh, bessel_j0, bessel_j1,
bessel_jn (elemental), bessel_y0, bessel_y1, bessel_yn (elemental),
cos, cosh, erf, erfc, erfc_scaled, exp, gamma, hypot, log, log10,
log_gamma, mod, sin, sqrt, sinh, sqrt, tan, tanh
++ Complex:
acos, acosh, asin, asinh, atan, atanh, cos, cosh, exp, log, sin,
sinh, sqrt, tan, tanh
Original-commit: flang-compiler/f18@
7e7d1920f882e7ca22c1320dd9b7e0a3d6eaec28
Tree-same-pre-rewrite: false
Jean Perier [Fri, 22 Mar 2019 10:17:06 +0000 (03:17 -0700)]
[flang] make HostIntrinsicProceduresLibrary a class
Original-commit: flang-compiler/f18@
b9f5015d4df0d43a639fe58684291df5665ee585
Tree-same-pre-rewrite: false
Jean Perier [Fri, 22 Mar 2019 10:14:10 +0000 (03:14 -0700)]
[flang] add the possibility to use libpgmath for constant folding
Original-commit: flang-compiler/f18@
948a6656277befa60311d38e728c550636cccb5b
Tree-same-pre-rewrite: false
Jean Perier [Fri, 22 Mar 2019 09:14:34 +0000 (02:14 -0700)]
[flang] Map more intrinsic functions to <cmath> functions
Original-commit: flang-compiler/f18@
f0f20622116cb0b5b63ae879ca99eccf38dced60
Tree-same-pre-rewrite: false
Jean Perier [Fri, 22 Mar 2019 09:01:22 +0000 (02:01 -0700)]
[flang] Move host floating point environment handling in host.h/host.cc
Original-commit: flang-compiler/f18@
0cba8b13089b12f4add5323e9c595e5367ece48e
Tree-same-pre-rewrite: false
Jean Perier [Thu, 21 Mar 2019 17:08:57 +0000 (10:08 -0700)]
[flang] Removed dynamic loading feature for intrinsic folding
After more reflexion, dynamic loading brings to much uncertainty
regarding which library is actually being use for folding.
It is removed to avoid pushing people to use it.
A static linking to libpgmath will be provided in a later commit.
Original-commit: flang-compiler/f18@
2161627d2896f06e763848443f61ae9624f03db1
Tree-same-pre-rewrite: false
Jean Perier [Mon, 4 Mar 2019 09:57:38 +0000 (01:57 -0800)]
[flang] fix clang++ linking issue with libm
Original-commit: flang-compiler/f18@
805c861bd0c96f2e124fa28664bd7914d9366677
Tree-same-pre-rewrite: false
Jean Perier [Fri, 1 Mar 2019 17:20:12 +0000 (09:20 -0800)]
[flang] renaming to focus scope on intrinsic runtime
Original-commit: flang-compiler/f18@
7cfd33b178d3ea3502ea87cb9416720f6cce4ba9
Tree-same-pre-rewrite: false
Jean Perier [Fri, 1 Mar 2019 14:47:47 +0000 (06:47 -0800)]
[flang] made fenv errors internal errors
Original-commit: flang-compiler/f18@
f776c8db91d6cd3bee295d73b92f52688d59b362
Tree-same-pre-rewrite: false
Jean Perier [Fri, 1 Mar 2019 13:50:06 +0000 (05:50 -0800)]
[flang] fix signed/unsigned comparison
Original-commit: flang-compiler/f18@
46148712e192da9bef7ae406639dcae714fefe1d
Tree-same-pre-rewrite: false
Jean Perier [Fri, 1 Mar 2019 12:27:10 +0000 (04:27 -0800)]
[flang] Limits C++ implementation behaviors
The issue addressed here is the use of cast between object pointers
and function pointers. It is implementation defined because C++,
just like C, does not mandate that function and object pointers
must have the same size.
It is needed to have such cast because it is a will to ba able to
call inside F18 numerical function from libraries linked during
a Fortran program compilation in order to perform folding.
dlopen returns function pointers as void* that need to be cast to
pointer before use.
This change limits the usage of such cast inside ifdefs where POSIX
is required. In POSIX context, such cast is defined. Dlopen is
anyway used only if the environment is POSIX compliant.
In the rest of the code, opaque function pointers have been changed
from void* to void*(*)(). reinterpret_cast from function pointer to
function pointer are standard compliant.
Original-commit: flang-compiler/f18@
4b2f29a1289e955469c9b9778a7db0034b0fce70
Tree-same-pre-rewrite: false
Jean Perier [Fri, 1 Mar 2019 12:15:04 +0000 (04:15 -0800)]
[flang] fixed use before init in elemental folding helper
Original-commit: flang-compiler/f18@
2cea43ddf94c369ff4446234e880a47ef306d847
Tree-same-pre-rewrite: false
Jean Perier [Mon, 25 Feb 2019 17:33:12 +0000 (09:33 -0800)]
[flang] add support to fold elemental intrisics over arrays
Original-commit: flang-compiler/f18@
c2fec22856b9bae7221036173c785d0732c7a7c3
Tree-same-pre-rewrite: false
Jean Perier [Mon, 25 Feb 2019 17:32:16 +0000 (09:32 -0800)]
[flang] answer comments on host/f18 type mappings
Original-commit: flang-compiler/f18@
96bce5c4d9348a325a6da30d08c78c56b5a906d3
Tree-same-pre-rewrite: false
Jean Perier [Fri, 22 Feb 2019 17:09:03 +0000 (09:09 -0800)]
[flang] Adds the possibility to use part of libpgmath for folding if it is available
Original-commit: flang-compiler/f18@
1c2093ff32bb4867d5024f076151e8b0160c7ede
Tree-same-pre-rewrite: false
Jean Perier [Fri, 22 Feb 2019 17:06:44 +0000 (09:06 -0800)]
[flang] answer some comments
Original-commit: flang-compiler/f18@
8161f77f60ee8efb491ace2b9e86d877296f655c
Tree-same-pre-rewrite: false
Jean Perier [Wed, 20 Feb 2019 16:55:00 +0000 (08:55 -0800)]
[flang] Use new indirection layer to host runtime in folding
Original-commit: flang-compiler/f18@
e8bb9c52afce3a4e6175bd4b1a3d4641f77491b9
Tree-same-pre-rewrite: false
Jean Perier [Wed, 20 Feb 2019 16:53:35 +0000 (08:53 -0800)]
[flang] Add RTE description structure and indirection layer to host runtime for folding
Original-commit: flang-compiler/f18@
329a61405204186d202b1072a17ee068e3d22b15
Tree-same-pre-rewrite: false
Jean Perier [Fri, 1 Feb 2019 16:30:23 +0000 (08:30 -0800)]
[flang] Cherry picking commits from #PR275 and simplifying it
Commit was: Draft of elemental intrinsics function folding
Simplification was made in order to solve conflicts and
to prepare for commit of host math library indirection.
Conflicts:
lib/evaluate/fold.cc
Original-commit: flang-compiler/f18@
45678bc44c796509a0d70a079e3912b11ebea2ab
Tree-same-pre-rewrite: false
Jean Perier [Fri, 1 Feb 2019 16:28:21 +0000 (08:28 -0800)]
[flang] Add a utility to safely interact with host types
Original-commit: flang-compiler/f18@
32cd789dc2036e888a23e146ff5b251827a1c0c4
Tree-same-pre-rewrite: false
Steve Scalpone [Wed, 27 Mar 2019 06:36:45 +0000 (23:36 -0700)]
[flang] Merge pull request flang-compiler/f18#356 from flang-compiler/if-semantics
Implement semantic checks for if statements, if constructs and arithmetic ifs.
Original-commit: flang-compiler/f18@
87acf05d0bdd438c768b17bd2e5a893616f04978
Reviewed-on: https://github.com/flang-compiler/f18/pull/356
Steve Scalpone [Wed, 27 Mar 2019 03:48:51 +0000 (20:48 -0700)]
[flang] Inline the constructors for IF semantics checkers.
Remove some leftover cruft from check-if-stmt.h too.
Original-commit: flang-compiler/f18@
5c150289a9f48a2fccd15af40d73d4c1e4a0a984
Reviewed-on: https://github.com/flang-compiler/f18/pull/356
Steve Scalpone [Wed, 27 Mar 2019 01:03:33 +0000 (18:03 -0700)]
[flang] Remove the IF specific context classes; in these cases they
added no value. Change several error messages to better say
what is expected. Adjust tests for new messages. Reformat
with llvm7 clang-format.
Original-commit: flang-compiler/f18@
706b506e26ac675ac443c5b616abda5c4cbd0523
Reviewed-on: https://github.com/flang-compiler/f18/pull/356
Tree-same-pre-rewrite: false
Steve Scalpone [Tue, 26 Mar 2019 07:33:03 +0000 (00:33 -0700)]
[flang] Implement semantic checks for if statements, if constructs and
arithmetic ifs.
Original-commit: flang-compiler/f18@
deb2726aad63b9bc4c7d35872b4b4279fbcc78f8
Reviewed-on: https://github.com/flang-compiler/f18/pull/356
Tree-same-pre-rewrite: false
Eric Schweitz [Sat, 23 Mar 2019 18:10:09 +0000 (11:10 -0700)]
[flang] Merge pull request flang-compiler/f18#353 from schweitzpgi/master
When computing the stack of scopes, a label on the first statement
Original-commit: flang-compiler/f18@
f665939b6148362ec80d4f923dba41f319857192
Reviewed-on: https://github.com/flang-compiler/f18/pull/353
Eric [Sat, 23 Mar 2019 02:20:16 +0000 (19:20 -0700)]
[flang] When computing the stack of scopes, a label on the first statement
that begins a construct should be considered as in the parent scope
rather that within the scope of the construct that is being entered.
Original-commit: flang-compiler/f18@
93da3538bcd31b165535dadefe4d67ee81a42ad9
Reviewed-on: https://github.com/flang-compiler/f18/pull/353
Eric Schweitz [Fri, 22 Mar 2019 23:01:19 +0000 (16:01 -0700)]
[flang] Merge pull request flang-compiler/f18#351 from schweitzpgi/master
implement the DO WHILE check
Original-commit: flang-compiler/f18@
230e75f803e6cd8a4592780178b6002583509d69
Reviewed-on: https://github.com/flang-compiler/f18/pull/351
Eric Schweitz [Fri, 22 Mar 2019 22:39:51 +0000 (15:39 -0700)]
[flang] Simply the test per review comment.
Original-commit: flang-compiler/f18@
66ab8bb2aaf43edd6b6351c85b255d354f85345c
Reviewed-on: https://github.com/flang-compiler/f18/pull/351
Eric Schweitz [Fri, 22 Mar 2019 21:54:45 +0000 (14:54 -0700)]
[flang] implement the DO WHILE check
Original-commit: flang-compiler/f18@
c367551041af03d07da05c4174c8541d57e11ae6
Reviewed-on: https://github.com/flang-compiler/f18/pull/351
Tree-same-pre-rewrite: false
Steve Scalpone [Fri, 22 Mar 2019 17:14:42 +0000 (10:14 -0700)]
[flang] Merge pull request flang-compiler/f18#345 from kiranchandramohan/c1167
C1167 : Check for exit statments in do-concurrent
Original-commit: flang-compiler/f18@
f5f6ed8e983bbaffe078e4b206efe95a975a6c85
Reviewed-on: https://github.com/flang-compiler/f18/pull/345
Kiran Chandramohan [Tue, 19 Mar 2019 18:15:36 +0000 (18:15 +0000)]
[flang] C1167 : Check for exit statments in do-concurrent
Addresses https://github.com/flang-compiler/f18/issues/288
Original-commit: flang-compiler/f18@
2a99e1ea5404fce9fd88ea2c9710ec4c01975eb6
Reviewed-on: https://github.com/flang-compiler/f18/pull/345
jeanPerier [Fri, 22 Mar 2019 07:27:17 +0000 (00:27 -0700)]
[flang] Add test framework for folding and fix minor bug found with it
Merge pull request flang-compiler/f18#347 from flang-compiler/jpr1
Original-commit: flang-compiler/f18@
547c9f3561a8ea6528ba417a268704e77f51e505
Jean Perier [Thu, 21 Mar 2019 15:49:38 +0000 (08:49 -0700)]
[flang] removed hard coded path
Original-commit: flang-compiler/f18@
d2fcd312576c304a52d962bd701e914c09c60d3c
Jean Perier [Thu, 21 Mar 2019 15:33:14 +0000 (08:33 -0700)]
[flang] Fix .NOT. folding bug
Original-commit: flang-compiler/f18@
dd4d9091f15ce3912937b9ceaac7efbbf793d0b5
Tree-same-pre-rewrite: false
Jean Perier [Thu, 21 Mar 2019 15:31:21 +0000 (08:31 -0700)]
[flang] Add test framework for folding
Original-commit: flang-compiler/f18@
d6b658c318ff6e5f61bb1c7490e96394fe7f03a8
Tree-same-pre-rewrite: false