On Thu, 21 Mar 2019, Jakub Jelinek wrote: > On Thu, Mar 21, 2019 at 09:35:07AM +0100, Richard Biener wrote: > > LGTM - any reason you only sometimes conditionalize add_tree_to_fld_list > > on the fld->pset.add () result? IMHO consistency should win over > > micro-optimizing the case you know the type will not be in the set. > > Yeah, it was a optimization for the most common case, when > find_decls_types_r calls add_tree_to_fld_list (t, fld); for DECL_P as well > as TYPE_P, because in that case the fld->pset.add check has been done > already by walk_tree. If we have hundreds thousands of elts in the > hash_set, it could be more than a microoptimization, but if you think > strongly that it should be all thrown away and add_tree_to_fld_list should > start with if (fld->pset.add (t)) return; then I can do that too.
Yes, I think that would be better. Richard.