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
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to