[flang-commits] flang-commits Digest, Vol 19, Issue 53
Rasmussen, Craig E. via flang-commits
flang-commits at lists.llvm.org
Mon Aug 30 16:08:21 PDT 2021
I’m looking for a place to put coarray intrinsic runtime declarations like num_images(). Since the external library will not be C++ (could even be implemented in Fortran with BIND(C) interface declarations), is this a reasonable place to put them. I don’t know if command.h was meant to only to declare command_argument_count().
Cheers,
Craig
From: flang-commits <flang-commits-bounces at lists.llvm.org> on behalf of via flang-commits <flang-commits at lists.llvm.org>
Date: Monday, August 30, 2021 at 11:41 AM
To: flang-commits at lists.llvm.org <flang-commits at lists.llvm.org>
Subject: flang-commits Digest, Vol 19, Issue 53
Send flang-commits mailing list submissions to
flang-commits at lists.llvm.org
To subscribe or unsubscribe via the World Wide Web, visit
https://urldefense.us/v3/__https://lists.llvm.org/cgi-bin/mailman/listinfo/flang-commits__;!!G2kpM7uM-TzIFchu!lXwlVjFY64XqiFWPUZXWG1tK3joj5d9xKRNYkmdorbvm_QW1yOiNH-Nugcxzdm2XDjia$<https://urldefense.us/v3/__https:/lists.llvm.org/cgi-bin/mailman/listinfo/flang-commits__;!!G2kpM7uM-TzIFchu!lXwlVjFY64XqiFWPUZXWG1tK3joj5d9xKRNYkmdorbvm_QW1yOiNH-Nugcxzdm2XDjia$>
or, via email, send a message with subject or body 'help' to
flang-commits-request at lists.llvm.org
You can reach the person managing the list at
flang-commits-owner at lists.llvm.org
When replying, please edit your Subject line so it is more specific
than "Re: Contents of flang-commits digest..."
Today's Topics:
1. [PATCH] D108687: [flang] Add runtime interface for
COMMAND_ARGUMENT_COUNT (Diana Picus via Phabricator via flang-commits)
2. [PATCH] D108688: [flang] Add runtime interface for
GET_COMMAND_ARGUMENT (Diana Picus via Phabricator via flang-commits)
3. [flang] 31fb52f - [flang] Apply double precision KindCode in
specific proc interface (Jean Perier via flang-commits)
4. [flang] 58e1a5e - [flang][mlir] Fix FIR after D108899
(Jean Perier via flang-commits)
5. [PATCH] D108931: [flang] Fold CSHIFT
(Peter Klausler via Phabricator via flang-commits)
----------------------------------------------------------------------
Message: 1
Date: Mon, 30 Aug 2021 07:42:03 +0000 (UTC)
From: Diana Picus via Phabricator via flang-commits
<flang-commits at lists.llvm.org>
To: diana.picus at linaro.org, pklausler at nvidia.com, jperier at nvidia.com
Cc: clementval at gmail.com, mats at planetcatfish.com, isuruf at gmail.com,
v.churavy at gmail.com, llvm-commits at lists.llvm.org, jdoerfert at anl.gov,
tim at tkeith.com, quic_sourabhs at quicinc.com, dougpuob at gmail.com,
rkauffmann at nvidia.com, bhuvanendra.kumarn at amd.com,
psteinfeld at nvidia.com, kiranchandramohan at gmail.com,
flang-commits at lists.llvm.org, yanliang.mu at intel.com
Subject: [flang-commits] [PATCH] D108687: [flang] Add runtime
interface for COMMAND_ARGUMENT_COUNT
Message-ID: <ZsypTGsRQ6ixJZkXrJtb3Q at ismtpd0156p1mdw1.sendgrid.net>
Content-Type: text/plain; charset="utf-8"
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGcc4d28691bbc: [flang] Add runtime interface for COMMAND_ARGUMENT_COUNT (authored by rovka).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://urldefense.us/v3/__https://reviews.llvm.org/D108687/new/__;!!G2kpM7uM-TzIFchu!lXwlVjFY64XqiFWPUZXWG1tK3joj5d9xKRNYkmdorbvm_QW1yOiNH-Nugcxzdn9kTy1w$<https://urldefense.us/v3/__https:/reviews.llvm.org/D108687/new/__;!!G2kpM7uM-TzIFchu!lXwlVjFY64XqiFWPUZXWG1tK3joj5d9xKRNYkmdorbvm_QW1yOiNH-Nugcxzdn9kTy1w$>
https://urldefense.us/v3/__https://reviews.llvm.org/D108687__;!!G2kpM7uM-TzIFchu!lXwlVjFY64XqiFWPUZXWG1tK3joj5d9xKRNYkmdorbvm_QW1yOiNH-NugcxzdiRp81oT$<https://urldefense.us/v3/__https:/reviews.llvm.org/D108687__;!!G2kpM7uM-TzIFchu!lXwlVjFY64XqiFWPUZXWG1tK3joj5d9xKRNYkmdorbvm_QW1yOiNH-NugcxzdiRp81oT$>
Files:
flang/runtime/command.h
Index: flang/runtime/command.h
===================================================================
--- /dev/null
+++ flang/runtime/command.h
@@ -0,0 +1,25 @@
+//===-- runtime/command.h ---------------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://urldefense.us/v3/__https://llvm.org/LICENSE.txt__;!!G2kpM7uM-TzIFchu!lXwlVjFY64XqiFWPUZXWG1tK3joj5d9xKRNYkmdorbvm_QW1yOiNH-NugcxzdhVciSr6$<https://urldefense.us/v3/__https:/llvm.org/LICENSE.txt__;!!G2kpM7uM-TzIFchu!lXwlVjFY64XqiFWPUZXWG1tK3joj5d9xKRNYkmdorbvm_QW1yOiNH-NugcxzdhVciSr6$> for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef FORTRAN_RUNTIME_COMMAND_H_
+#define FORTRAN_RUNTIME_COMMAND_H_
+
+#include "cpp-type.h"
+#include "entry-names.h"
+
+namespace Fortran::runtime {
+extern "C" {
+// 16.9.51 COMMAND_ARGUMENT_COUNT
+//
+// Lowering may need to cast the result to match the precision of the default
+// integer kind.
+CppTypeFor<TypeCategory::Integer, 4> RTNAME(ArgumentCount)();
+}
+} // namespace Fortran::runtime
+
+#endif // FORTRAN_RUNTIME_COMMAND_H_
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D108687.369388.patch
Type: text/x-patch
Size: 980 bytes
Desc: not available
URL: <https://urldefense.us/v3/__http://lists.llvm.org/pipermail/flang-commits/attachments/20210830/e3a23300/attachment-0001.bin__;!!G2kpM7uM-TzIFchu!lXwlVjFY64XqiFWPUZXWG1tK3joj5d9xKRNYkmdorbvm_QW1yOiNH-NugcxzdvKwhsuD$ >
------------------------------
Message: 2
Date: Mon, 30 Aug 2021 07:42:07 +0000 (UTC)
From: Diana Picus via Phabricator via flang-commits
<flang-commits at lists.llvm.org>
To: diana.picus at linaro.org, pklausler at nvidia.com, jperier at nvidia.com
Cc: clementval at gmail.com, mats at planetcatfish.com, isuruf at gmail.com,
v.churavy at gmail.com, llvm-commits at lists.llvm.org, jdoerfert at anl.gov,
tim at tkeith.com, quic_sourabhs at quicinc.com, dougpuob at gmail.com,
rkauffmann at nvidia.com, bhuvanendra.kumarn at amd.com,
psteinfeld at nvidia.com, kiranchandramohan at gmail.com,
flang-commits at lists.llvm.org, yanliang.mu at intel.com
Subject: [flang-commits] [PATCH] D108688: [flang] Add runtime
interface for GET_COMMAND_ARGUMENT
Message-ID: <CUfnL7NoS9qWtgfVZOxN0Q at ismtpd0161p1mdw1.sendgrid.net>
Content-Type: text/plain; charset="utf-8"
This revision was automatically updated to reflect the committed changes.
Closed by commit rG4fae60c4b0ed: [flang] Add runtime interface for GET_COMMAND_ARGUMENT (authored by rovka).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://urldefense.us/v3/__https://reviews.llvm.org/D108688/new/__;!!G2kpM7uM-TzIFchu!lXwlVjFY64XqiFWPUZXWG1tK3joj5d9xKRNYkmdorbvm_QW1yOiNH-Nugcxzdms6NVCK$<https://urldefense.us/v3/__https:/reviews.llvm.org/D108688/new/__;!!G2kpM7uM-TzIFchu!lXwlVjFY64XqiFWPUZXWG1tK3joj5d9xKRNYkmdorbvm_QW1yOiNH-Nugcxzdms6NVCK$>
https://urldefense.us/v3/__https://reviews.llvm.org/D108688__;!!G2kpM7uM-TzIFchu!lXwlVjFY64XqiFWPUZXWG1tK3joj5d9xKRNYkmdorbvm_QW1yOiNH-Nugcxzdgd8ri7j$<https://urldefense.us/v3/__https:/reviews.llvm.org/D108688__;!!G2kpM7uM-TzIFchu!lXwlVjFY64XqiFWPUZXWG1tK3joj5d9xKRNYkmdorbvm_QW1yOiNH-Nugcxzdgd8ri7j$>
Files:
flang/runtime/command.h
Index: flang/runtime/command.h
===================================================================
--- flang/runtime/command.h
+++ flang/runtime/command.h
@@ -13,12 +13,29 @@
#include "entry-names.h"
namespace Fortran::runtime {
+class Descriptor;
+
extern "C" {
// 16.9.51 COMMAND_ARGUMENT_COUNT
//
// Lowering may need to cast the result to match the precision of the default
// integer kind.
CppTypeFor<TypeCategory::Integer, 4> RTNAME(ArgumentCount)();
+
+// 16.9.83 GET_COMMAND_ARGUMENT
+// We're breaking up the interface into several different functions, since most
+// of the parameters are optional.
+
+// Try to get the value of the n'th argument.
+// Returns a STATUS as described in the standard.
+CppTypeFor<TypeCategory::Integer, 4> RTNAME(ArgumentValue)(
+ CppTypeFor<TypeCategory::Integer, 4> n, const Descriptor *value,
+ const Descriptor *errmsg);
+
+// Try to get the significant length of the n'th argument.
+// Returns 0 if it doesn't manage.
+CppTypeFor<TypeCategory::Integer, 4> RTNAME(ArgumentLength)(
+ CppTypeFor<TypeCategory::Integer, 4> n);
}
} // namespace Fortran::runtime
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D108688.369389.patch
Type: text/x-patch
Size: 1126 bytes
Desc: not available
URL: <https://urldefense.us/v3/__http://lists.llvm.org/pipermail/flang-commits/attachments/20210830/d92616c4/attachment-0001.bin__;!!G2kpM7uM-TzIFchu!lXwlVjFY64XqiFWPUZXWG1tK3joj5d9xKRNYkmdorbvm_QW1yOiNH-NugcxzdjGUNrrF$ >
------------------------------
Message: 3
Date: Mon, 30 Aug 2021 00:00:21 -0700 (PDT)
From: Jean Perier via flang-commits <flang-commits at lists.llvm.org>
To: flang-commits at lists.llvm.org
Subject: [flang-commits] [flang] 31fb52f - [flang] Apply double
precision KindCode in specific proc interface
Message-ID: <612c8205.1c69fb81.8b2fd.2be1 at mx.google.com>
Content-Type: text/plain; charset="utf-8"
Author: Jean Perier
Date: 2021-08-30T08:59:58+02:00
New Revision: 31fb52f8749ee43385cd7a9c8064c3adf58b2596
URL: https://urldefense.us/v3/__https://github.com/llvm/llvm-project/commit/31fb52f8749ee43385cd7a9c8064c3adf58b2596__;!!G2kpM7uM-TzIFchu!lXwlVjFY64XqiFWPUZXWG1tK3joj5d9xKRNYkmdorbvm_QW1yOiNH-NugcxzdrJ0wCHR$<https://urldefense.us/v3/__https:/github.com/llvm/llvm-project/commit/31fb52f8749ee43385cd7a9c8064c3adf58b2596__;!!G2kpM7uM-TzIFchu!lXwlVjFY64XqiFWPUZXWG1tK3joj5d9xKRNYkmdorbvm_QW1yOiNH-NugcxzdrJ0wCHR$>
DIFF: https://urldefense.us/v3/__https://github.com/llvm/llvm-project/commit/31fb52f8749ee43385cd7a9c8064c3adf58b2596.diff__;!!G2kpM7uM-TzIFchu!lXwlVjFY64XqiFWPUZXWG1tK3joj5d9xKRNYkmdorbvm_QW1yOiNH-Nugcxzdu3NCcz9$<https://urldefense.us/v3/__https:/github.com/llvm/llvm-project/commit/31fb52f8749ee43385cd7a9c8064c3adf58b2596.diff__;!!G2kpM7uM-TzIFchu!lXwlVjFY64XqiFWPUZXWG1tK3joj5d9xKRNYkmdorbvm_QW1yOiNH-Nugcxzdu3NCcz9$>
LOG: [flang] Apply double precision KindCode in specific proc interface
The double precision KindCode was ignored when building the interface
of specific intrinsic procedures leading to bad semantics checks.
Differential Revision: https://urldefense.us/v3/__https://reviews.llvm.org/D108828__;!!G2kpM7uM-TzIFchu!lXwlVjFY64XqiFWPUZXWG1tK3joj5d9xKRNYkmdorbvm_QW1yOiNH-NugcxzduSVOzQm$<https://urldefense.us/v3/__https:/reviews.llvm.org/D108828__;!!G2kpM7uM-TzIFchu!lXwlVjFY64XqiFWPUZXWG1tK3joj5d9xKRNYkmdorbvm_QW1yOiNH-NugcxzduSVOzQm$>
Added:
flang/test/Semantics/call20.f90
Modified:
flang/lib/Evaluate/intrinsics.cpp
Removed:
################################################################################
diff --git a/flang/lib/Evaluate/intrinsics.cpp b/flang/lib/Evaluate/intrinsics.cpp
index ae9e7c4599869..374d540549c5d 100644
--- a/flang/lib/Evaluate/intrinsics.cpp
+++ b/flang/lib/Evaluate/intrinsics.cpp
@@ -2353,7 +2353,11 @@ DynamicType IntrinsicProcTable::Implementation::GetSpecificType(
const CategorySet &set{pattern.categorySet};
CHECK(set.count() == 1);
TypeCategory category{set.LeastElement().value()};
- return DynamicType{category, defaults_.GetDefaultKind(category)};
+ if (pattern.kindCode == KindCode::doublePrecision) {
+ return DynamicType{category, defaults_.doublePrecisionKind()};
+ } else {
+ return DynamicType{category, defaults_.GetDefaultKind(category)};
+ }
}
IntrinsicProcTable::~IntrinsicProcTable() = default;
diff --git a/flang/test/Semantics/call20.f90 b/flang/test/Semantics/call20.f90
new file mode 100644
index 0000000000000..2ce7b1ced2f63
--- /dev/null
+++ b/flang/test/Semantics/call20.f90
@@ -0,0 +1,39 @@
+! RUN: %S/test_errors.sh %s %t %flang_fc1
+! REQUIRES: shell
+
+! Test that the interface of specific intrinsics passed as dummy arguments
+! are correctly validated against actual arguments explicit interface.
+
+ intrinsic :: abs, dabs
+ interface
+ subroutine foo(f)
+ interface
+ function f(x)
+ real :: f
+ real, intent(in) :: x
+ end function
+ end interface
+ end subroutine
+
+ subroutine foo2(f)
+ interface
+ function f(x)
+ double precision :: f
+ double precision, intent(in) :: x
+ end function
+ end interface
+ end subroutine
+ end interface
+
+ ! OK
+ call foo(abs)
+
+ ! OK
+ call foo2(dabs)
+
+ !ERROR: Actual procedure argument has interface incompatible with dummy argument 'f='
+ call foo(dabs)
+
+ !ERROR: Actual procedure argument has interface incompatible with dummy argument 'f='
+ call foo2(abs)
+end
------------------------------
Message: 4
Date: Mon, 30 Aug 2021 04:52:56 -0700 (PDT)
From: Jean Perier via flang-commits <flang-commits at lists.llvm.org>
To: flang-commits at lists.llvm.org
Subject: [flang-commits] [flang] 58e1a5e - [flang][mlir] Fix FIR after
D108899
Message-ID: <612cc698.1c69fb81.696d0.991b at mx.google.com>
Content-Type: text/plain; charset="utf-8"
Author: Jean Perier
Date: 2021-08-30T13:51:39+02:00
New Revision: 58e1a5e4c29325dc985ad4976d65fab53f05e946
URL: https://urldefense.us/v3/__https://github.com/llvm/llvm-project/commit/58e1a5e4c29325dc985ad4976d65fab53f05e946__;!!G2kpM7uM-TzIFchu!lXwlVjFY64XqiFWPUZXWG1tK3joj5d9xKRNYkmdorbvm_QW1yOiNH-Nugcxzdnup9xPf$<https://urldefense.us/v3/__https:/github.com/llvm/llvm-project/commit/58e1a5e4c29325dc985ad4976d65fab53f05e946__;!!G2kpM7uM-TzIFchu!lXwlVjFY64XqiFWPUZXWG1tK3joj5d9xKRNYkmdorbvm_QW1yOiNH-Nugcxzdnup9xPf$>
DIFF: https://urldefense.us/v3/__https://github.com/llvm/llvm-project/commit/58e1a5e4c29325dc985ad4976d65fab53f05e946.diff__;!!G2kpM7uM-TzIFchu!lXwlVjFY64XqiFWPUZXWG1tK3joj5d9xKRNYkmdorbvm_QW1yOiNH-Nugcxzdve1BemA$<https://urldefense.us/v3/__https:/github.com/llvm/llvm-project/commit/58e1a5e4c29325dc985ad4976d65fab53f05e946.diff__;!!G2kpM7uM-TzIFchu!lXwlVjFY64XqiFWPUZXWG1tK3joj5d9xKRNYkmdorbvm_QW1yOiNH-Nugcxzdve1BemA$>
LOG: [flang][mlir] Fix FIR after D108899
After 41d4aa7de68ed551010f27ff04ffc54e7616292a, some builder.getStringAttr
calls in FIR were wrong.
Added:
Modified:
flang/include/flang/Optimizer/Dialect/FIROps.td
flang/lib/Optimizer/Dialect/FIROps.cpp
Removed:
################################################################################
diff --git a/flang/include/flang/Optimizer/Dialect/FIROps.td b/flang/include/flang/Optimizer/Dialect/FIROps.td
index 51336e15fb8b1..2d756fc1e961f 100644
--- a/flang/include/flang/Optimizer/Dialect/FIROps.td
+++ b/flang/include/flang/Optimizer/Dialect/FIROps.td
@@ -3281,7 +3281,7 @@ def fir_DispatchTableOp : fir_Op<"dispatch_table",
// Convert the parsed name attr into a string attr.
result.attributes.set(mlir::SymbolTable::getSymbolAttrName(),
- parser.getBuilder().getStringAttr(nameAttr.getRootReference()));
+ nameAttr.getRootReference());
// Parse the optional table body.
mlir::Region *body = result.addRegion();
diff --git a/flang/lib/Optimizer/Dialect/FIROps.cpp b/flang/lib/Optimizer/Dialect/FIROps.cpp
index ecdcdfcaaaea5..789964c7f8968 100644
--- a/flang/lib/Optimizer/Dialect/FIROps.cpp
+++ b/flang/lib/Optimizer/Dialect/FIROps.cpp
@@ -581,7 +581,7 @@ static ParseResult parseGlobalOp(OpAsmParser &parser, OperationState &result) {
result.attributes))
return mlir::failure();
result.addAttribute(mlir::SymbolTable::getSymbolAttrName(),
- builder.getStringAttr(nameAttr.getRootReference()));
+ nameAttr.getRootReference());
bool simpleInitializer = false;
if (mlir::succeeded(parser.parseOptionalLParen())) {
------------------------------
Message: 5
Date: Mon, 30 Aug 2021 18:41:46 +0000 (UTC)
From: Peter Klausler via Phabricator via flang-commits
<flang-commits at lists.llvm.org>
To: pklausler at nvidia.com, psteinfeld at nvidia.com, sscalpone at nvidia.com
Cc: clementval at gmail.com, isuruf at gmail.com, v.churavy at gmail.com,
flang-commits at lists.llvm.org, tim at tkeith.com,
quic_sourabhs at quicinc.com, rkauffmann at nvidia.com,
bhuvanendra.kumarn at amd.com, jdoerfert at anl.gov,
kiranchandramohan at gmail.com
Subject: [flang-commits] [PATCH] D108931: [flang] Fold CSHIFT
Message-ID: <yPsK7QrFS9iv7kvlm7y_iw at ismtpd0195p1mdw1.sendgrid.net>
Content-Type: text/plain; charset="utf-8"
klausler created this revision.
klausler added a reviewer: PeteSteinfeld.
klausler added a project: Flang.
Herald added a subscriber: jdoerfert.
Herald added a reviewer: sscalpone.
klausler requested review of this revision.
Implement folding of the transformational intrinsic function
CSHIFT for all types.
https://urldefense.us/v3/__https://reviews.llvm.org/D108931__;!!G2kpM7uM-TzIFchu!lXwlVjFY64XqiFWPUZXWG1tK3joj5d9xKRNYkmdorbvm_QW1yOiNH-NugcxzdgMo8XhL$<https://urldefense.us/v3/__https:/reviews.llvm.org/D108931__;!!G2kpM7uM-TzIFchu!lXwlVjFY64XqiFWPUZXWG1tK3joj5d9xKRNYkmdorbvm_QW1yOiNH-NugcxzdgMo8XhL$>
Files:
flang/include/flang/Evaluate/tools.h
flang/lib/Evaluate/fold-character.cpp
flang/lib/Evaluate/fold-complex.cpp
flang/lib/Evaluate/fold-implementation.h
flang/lib/Evaluate/fold-integer.cpp
flang/lib/Evaluate/fold-logical.cpp
flang/lib/Evaluate/fold-real.cpp
flang/test/Evaluate/folding22.f90
flang/test/Evaluate/folding27.f90
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D108931.369508.patch
Type: text/x-patch
Size: 10011 bytes
Desc: not available
URL: <https://urldefense.us/v3/__http://lists.llvm.org/pipermail/flang-commits/attachments/20210830/d7044c72/attachment.bin__;!!G2kpM7uM-TzIFchu!lXwlVjFY64XqiFWPUZXWG1tK3joj5d9xKRNYkmdorbvm_QW1yOiNH-NugcxzdqirQEYO$ >
------------------------------
Subject: Digest Footer
_______________________________________________
flang-commits mailing list
flang-commits at lists.llvm.org
https://urldefense.us/v3/__https://lists.llvm.org/cgi-bin/mailman/listinfo/flang-commits__;!!G2kpM7uM-TzIFchu!lXwlVjFY64XqiFWPUZXWG1tK3joj5d9xKRNYkmdorbvm_QW1yOiNH-Nugcxzdm2XDjia$<https://urldefense.us/v3/__https:/lists.llvm.org/cgi-bin/mailman/listinfo/flang-commits__;!!G2kpM7uM-TzIFchu!lXwlVjFY64XqiFWPUZXWG1tK3joj5d9xKRNYkmdorbvm_QW1yOiNH-Nugcxzdm2XDjia$>
------------------------------
End of flang-commits Digest, Vol 19, Issue 53
*********************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20210830/9b572b1a/attachment-0001.html>
More information about the flang-commits
mailing list