[clang] [Clang] Improve subsumption. (PR #132849)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 27 09:06:01 PDT 2025


================
@@ -170,102 +132,112 @@ struct alignas(ConstraintAlignment) FoldExpandedConstraint {
                          const Expr *Pattern)
       : Kind(K), Constraint(std::move(C)), Pattern(Pattern) {};
 
-  template <typename AtomicSubsumptionEvaluator>
-  bool subsumes(const FoldExpandedConstraint &Other,
-                const AtomicSubsumptionEvaluator &E) const;
-
   static bool AreCompatibleForSubsumption(const FoldExpandedConstraint &A,
                                           const FoldExpandedConstraint &B);
+
+  llvm::FoldingSetNodeID ProfileForSubsumption() const;
----------------
AaronBallman wrote:

> This was just a (poorly named) attempt to produce a cache key for atomic constraint generically (we do it in two places but both places do it differently) - i just forgot to cleanup after myself

Ah, yeah, I think I figured that out after posting the comment. Removal makes sense to me now.

> Completely unrelated but it might be a good in a follow up. But what we should profile there is more "how much time is spent finding the most constraint candidate"

Yeah, follow-up is fine by me. I think what would be interesting to profile is "how much time is spent determining whether a constraint is met when instantiating a template" and "how much time is spent checking each individual constraint".

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


More information about the cfe-commits mailing list