[llvm-branch-commits] [flang] [llvm] [flang][OpenMP] Don't treat different runtime conditions as subsets (PR #233493)

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Oct 20 21:08:57 PDT 2026


================
@@ -2579,6 +2585,24 @@ std::optional<MetadirectiveCandidateSet> BuildMetadirectiveCandidateSet(
     return spec.DirId() == llvm::omp::Directive::OMPD_nothing ? nullptr : &spec;
   };
 
+  // Identify each distinct runtime condition, so that different conditions
+  // are not strict subsets of each other.
+  llvm::SmallVector<SomeExpr, 4> runtimeConditions;
+  auto getConditionKey = [&](const DynamicUserCondition &condition) {
+    const SomeExpr *expr{GetExpr(context, *condition.expr)};
+    if (!expr ||
+        evaluate::IsActuallyConstant(
----------------
chichunchen wrote:

`EvaluateUserCondition` now folds logical constants of any kind, and `getConditionKey` no longer has its own constant check. Your example now emits unconditional TASKYIELD, also with `.false.` under `-fdefault-integer-8`.

https://github.com/llvm/llvm-project/pull/233493


More information about the llvm-branch-commits mailing list