[clang] [clang][AST] Add 'IgnoreTemplateParmDepth' to structural equivalence cache (PR #115518)

DonĂ¡t Nagy via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 12 03:49:58 PST 2024


NagyDonat wrote:

The array-based solution can be extended to cover more than two separate cache sets by replacing the `bool` with a suitable enum (or a bitfield where independent flags are combined by bitwise or). It will stay more effective than the "use a single set and store 3-tuples instead of pairs" solution as long as `(number of cache entries) * sizeof(int) > (number of separate cache sets) * sizeof(empty DenseSet)` holds. (Nitpick: I'm saying `sizeof(int)`, but the alignment of the 3-tuples with pointer fields probably means that the effective size of each set element is increased by a pointer.)

Moreover, as the set of my inline comments shows, it's really easy to convert between the two approaches if the evolution of the codebase makes that necessary -- there is no need to aggressively future-proof this decision.

Finally, this is all just bikeshedding and both potential solutions are better than spending more review rounds on this discussion. I'm fine with either implementation, let's merge one of them!


  



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


More information about the cfe-commits mailing list