[flang] [llvm] [Flang] Adding lowering for the allocation and deallocation of coarrays (PR #182110)
Dan Bonachea via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 5 21:01:47 PST 2026
================
@@ -0,0 +1,45 @@
+//===-- runtime/coarray.cpp -----------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "flang/Runtime/coarray.h"
+#include "flang-rt/runtime/descriptor.h"
+#include "flang-rt/runtime/terminator.h"
+#include "flang-rt/runtime/type-info.h"
+
+namespace Fortran::runtime {
+
+extern "C" {
+RT_EXT_API_GROUP_BEGIN
+
+void RTDEF(ComputeLastUcobound)(
+ int num_images, const Descriptor &lcobounds, const Descriptor &ucobounds) {
----------------
bonachea wrote:
With the release of [Caffeine 0.7.2](https://github.com/BerkeleyLab/caffeine/releases/tag/0.7.2), this routine should no longer be necessary. The compiler is now permitted/encouraged to omit the trailing ucobound when calling `prif_allocate_coarray`. This relaxation is expected to be formalized in the next PRIF revision.
As a result, I believe this file and the corresponding header can be deleted, and the sole caller in `MIFOpConversion.cpp:genCoBounds()` can be simplified to just omit the trailing ucobounds element.
https://github.com/llvm/llvm-project/pull/182110
More information about the llvm-commits
mailing list