[flang-commits] [flang] [flang] Regularize TODO messages for coarray intrinsics (PR #70281)
via flang-commits
flang-commits at lists.llvm.org
Wed Oct 25 19:07:45 PDT 2023
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-flang-fir-hlfir
Author: Pete Steinfeld (psteinfeld)
<details>
<summary>Changes</summary>
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.
---
Full diff: https://github.com/llvm/llvm-project/pull/70281.diff
1 Files Affected:
- (modified) flang/lib/Optimizer/Builder/IntrinsicCall.cpp (+8)
``````````diff
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));
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/70281
More information about the flang-commits
mailing list