On Thu, May 5, 2022 at 8:12 PM Martin Liška <mli...@suse.cz> wrote: > > On 5/5/22 17:31, Segher Boessenkool wrote: > > On Thu, May 05, 2022 at 09:06:45AM -0400, Marek Polacek via Gcc-patches > > wrote: > >> On Thu, May 05, 2022 at 02:31:05PM +0200, Martin Liška wrote: > >>> Some parts of the compiler already define: > >>> #define likely(cond) __builtin_expect ((cond), 1) > >>> > >>> So the patch should unify it. > > > >> That's funny, yesterday I added another one: > >> cp/parser.cc:cp_parser_init_declarator > >> which is not replaced in this patch. > >> > >> I would've preferred the name gcc_{,un}likely but I don't want to start > >> a long bikeshedding... > > > > GCC_LIKELY is fine with me. A bare LIKELY isn't though. We have much > > more common macros having LIKELY in the name already (PROB_*LIKELY, > > CLASS_LIKELY_SPILLED, the various IPA things, loop versioning, etc.), > > but also we have LIKELY and UNLIKELY as function arguments in various > > places. > > Well, out of the 2 suggested names (GCC_LIKELY and gcc_likely), I prefer > GCC_LIKELY. > You are right that LIKELY may confuse various people. > > Is the community fine with the suggested name?
GCC_ isn't any more special though. With quoting the other _LIKELY macros a better name would be COND[ITION]_LIKELY, not GCC_LIKELY? But I would have been fine with LIKELY as well. Richard. > Martin > > > > > > > Segher >