[flang-commits] [clang] [flang] [llvm] [OpenMP] Fix context selector matching and scoring (PR #231668)

via flang-commits flang-commits at lists.llvm.org
Sat Oct 17 18:14:58 PDT 2026


================
@@ -172,7 +170,8 @@ static bool isStrictSubset(const VariantMatchInfo &VMI0,
   for (unsigned Bit : VMI0.RequiredTraits.set_bits())
     if (!VMI1.RequiredTraits.test(Bit))
       return false;
-  if (!isSubset<TraitProperty>(VMI0.ConstructTraits, VMI1.ConstructTraits))
+  if (!isOrderedSubset<TraitProperty>(VMI0.ConstructTraits,
----------------
chichunchen wrote:

Thanks, this is also tracked in #233036. The `RequiredTraits.count()` guard is on main: the issue's `repeated_construct_subset` example already ties at 8 and picks the wrong variant without this PR's scoring changes. Choosing the highest-valued construct match makes such ties more common.

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


More information about the flang-commits mailing list