================
@@ -172,6 +172,16 @@ static bool isStrictSubset(const VariantMatchInfo &VMI0,
for (unsigned Bit : VMI0.RequiredTraits.set_bits())
if (!VMI1.RequiredTraits.test(Bit))
return false;
+ // Different runtime conditions share a trait, so compare them as well.
+ // A runtime condition can be left out of the traits but keep its key.
+ if (!VMI0.UserCondition.empty() && VMI0.UserCondition != VMI1.UserCondition)
----------------
MattPD wrote:
Could `isStrictSubset` count a retained condition when its trait has been
removed from `RequiredTraits`? The first and third WHEN selectors in this
reproducer are identical. The first WHEN remains applicable through
`vendor(llvm)` even when `a` is false. [The
base](https://github.com/llvm/llvm-project/commit/6278453680db4f0058ca12663f87b84c1b914ea4)
emits unconditional TASKYIELD. The reviewed head instead emits TASKWAIT when
`a` is false and `command_argument_count()` is positive.
You can reproduce this by saving the following as `repro.f90` and running
`flang -fopenmp -fopenmp-version=52 -S -emit-llvm repro.f90 -o -`:
```fortran
subroutine same_condition(a)
logical, intent(in) :: a
!$omp metadirective &
!$omp& when(user={condition(a)}, &
!$omp& implementation={vendor(score(2): llvm), extension(match_any)}:
taskyield) &
!$omp& when(user={condition(command_argument_count() > 0)}, &
!$omp& implementation={vendor(score(2): llvm)}: taskwait) &
!$omp& when(user={condition(a)}, &
!$omp& implementation={vendor(score(2): llvm), extension(match_any)}: barrier)
end subroutine
```
https://github.com/llvm/llvm-project/pull/233493
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits