Re: RFC (branch prediction): PATCH to implement P0479R5, [[likely]] and [[unlikely]].

2019-02-19 Thread Martin Liška
On 2/18/19 8:34 PM, Jason Merrill wrote: > Fixed thus: Works for me, thanks! Martin

Re: RFC (branch prediction): PATCH to implement P0479R5, [[likely]] and [[unlikely]].

2019-02-18 Thread Jason Merrill
On 2/18/19 7:44 AM, Martin Liška wrote: PING^1 On 11/30/18 11:26 AM, Martin Liška wrote: Hi Jason. Just small nits I noticed for: cat test4.C int a, b, c; void __attribute__((noinline)) bar() { if (a == 123) [[likely]] c = 5; else [[likely]] b = 77; } int main() { bar ();

Re: RFC (branch prediction): PATCH to implement P0479R5, [[likely]] and [[unlikely]].

2019-02-18 Thread Martin Liška
PING^1 On 11/30/18 11:26 AM, Martin Liška wrote: > Hi Jason. > > Just small nits I noticed for: > > cat test4.C > int a, b, c; > > void > __attribute__((noinline)) > bar() > { > if (a == 123) > [[likely]] c = 5; > else > [[likely]] b = 77; > } > > int main() > { > bar (); > ret

Re: RFC (branch prediction): PATCH to implement P0479R5, [[likely]] and [[unlikely]].

2018-11-30 Thread Martin Liška
Hi Jason. Just small nits I noticed for: cat test4.C int a, b, c; void __attribute__((noinline)) bar() { if (a == 123) [[likely]] c = 5; else [[likely]] b = 77; } int main() { bar (); return 0; } $ g++ test4.C -c test4.C: In function ‘void bar()’: test4.C:8:16: warning: both br

Re: RFC (branch prediction): PATCH to implement P0479R5, [[likely]] and [[unlikely]].

2018-11-16 Thread Jan Hubicka
> On Thu, Nov 15, 2018 at 7:14 AM Jan Hubicka wrote: > > > > > > A warning seems appropriate. You think the front end is the right > > > > place for that? > > > > > > Probably yes. Note that middle-end can optimize about dead branches and > > > so that > > > theoretically one can end up with a b

Re: RFC (branch prediction): PATCH to implement P0479R5, [[likely]] and [[unlikely]].

2018-11-16 Thread Jason Merrill
On Thu, Nov 15, 2018 at 7:14 AM Jan Hubicka wrote: > > > > A warning seems appropriate. You think the front end is the right > > > place for that? > > > > Probably yes. Note that middle-end can optimize about dead branches and so > > that > > theoretically one can end up with a branching where e

Re: RFC (branch prediction): PATCH to implement P0479R5, [[likely]] and [[unlikely]].

2018-11-15 Thread Jan Hubicka
> > A warning seems appropriate. You think the front end is the right > > place for that? > > Probably yes. Note that middle-end can optimize about dead branches and so > that > theoretically one can end up with a branching where e.g. both branches are > [[likely]]. > I wouldn't bother users wi

Re: RFC (branch prediction): PATCH to implement P0479R5, [[likely]] and [[unlikely]].

2018-11-15 Thread Martin Liška
On 11/13/18 8:42 PM, Jason Merrill wrote: > On Tue, Nov 13, 2018 at 9:20 AM Martin Liška wrote: >> >> On 11/13/18 5:43 AM, Jason Merrill wrote: >>> [[likely]] and [[unlikely]] are equivalent to the GNU hot/cold attributes, >>> except that they can be applied to arbitrary statements as well as labe

Re: RFC (branch prediction): PATCH to implement P0479R5, [[likely]] and [[unlikely]].

2018-11-13 Thread Jason Merrill
On Tue, Nov 13, 2018 at 9:20 AM Martin Liška wrote: > > On 11/13/18 5:43 AM, Jason Merrill wrote: > > [[likely]] and [[unlikely]] are equivalent to the GNU hot/cold attributes, > > except that they can be applied to arbitrary statements as well as labels; > > this is most likely to be useful for m

Re: RFC (branch prediction): PATCH to implement P0479R5, [[likely]] and [[unlikely]].

2018-11-13 Thread Martin Liška
On 11/13/18 5:43 AM, Jason Merrill wrote: > [[likely]] and [[unlikely]] are equivalent to the GNU hot/cold attributes, > except that they can be applied to arbitrary statements as well as labels; > this is most likely to be useful for marking if/else branches as likely or > unlikely. Conveniently,

RFC (branch prediction): PATCH to implement P0479R5, [[likely]] and [[unlikely]].

2018-11-12 Thread Jason Merrill
[[likely]] and [[unlikely]] are equivalent to the GNU hot/cold attributes, except that they can be applied to arbitrary statements as well as labels; this is most likely to be useful for marking if/else branches as likely or unlikely. Conveniently, PREDICT_EXPR fits the bill nicely as a representa