[flang-commits] [flang] 38c9fab - [flang] Regularize TODO messages for coarray intrinsics (#70281)
via flang-commits
flang-commits at lists.llvm.org
Thu Oct 26 05:50:42 PDT 2023
Author: Pete Steinfeld
Date: 2023-10-26T05:50:38-07:00
New Revision: 38c9fab8f34a17462d03eb39fd2d6363f0c81f3e
URL: https://github.com/llvm/llvm-project/commit/38c9fab8f34a17462d03eb39fd2d6363f0c81f3e
DIFF: https://github.com/llvm/llvm-project/commit/38c9fab8f34a17462d03eb39fd2d6363f0c81f3e.diff
LOG: [flang] Regularize TODO messages for coarray intrinsics (#70281)
Apply a tag to coarray intrinsics to make them easier to recognize along
with other coarray constructs.
See pull request #69227 for a similar change.
Added:
Modified:
flang/lib/Optimizer/Builder/IntrinsicCall.cpp
Removed:
################################################################################
diff --git a/flang/lib/Optimizer/Builder/IntrinsicCall.cpp b/flang/lib/Optimizer/Builder/IntrinsicCall.cpp
index 0a023bc6b21ea03..fe40fd821f01013 100644
--- a/flang/lib/Optimizer/Builder/IntrinsicCall.cpp
+++ b/flang/lib/Optimizer/Builder/IntrinsicCall.cpp
@@ -1343,6 +1343,12 @@ static bool isIntrinsicModuleProcedure(llvm::StringRef name) {
name.startswith("ieee_") || name.startswith("__ppc_");
}
+static bool isCoarrayIntrinsic(llvm::StringRef name) {
+ return name.startswith("atomic_") || name.startswith("co_") ||
+ name.contains("image") || name.endswith("cobound") ||
+ name.equals("team_number");
+}
+
/// Return the generic name of an intrinsic module procedure specific name.
/// Remove any "__builtin_" prefix, and any specific suffix of the form
/// {_[ail]?[0-9]+}*, such as _1 or _a4.
@@ -1363,6 +1369,8 @@ llvm::StringRef genericName(llvm::StringRef specificName) {
void crashOnMissingIntrinsic(mlir::Location loc, llvm::StringRef name) {
if (isIntrinsicModuleProcedure(name))
TODO(loc, "intrinsic module procedure: " + llvm::Twine(name));
+ else if (isCoarrayIntrinsic(name))
+ TODO(loc, "coarray: intrinsic " + llvm::Twine(name));
else
TODO(loc, "intrinsic: " + llvm::Twine(name));
}
More information about the flang-commits
mailing list