__builtin_expect vs inlining

Richard Henderson
2001-05-05T17:08:39Z

On Sat, May 05, 2001 at 06:17:18PM +0400, Ivan Kokshaysky wrote:
> > Eh? Would you give me an example that isn't working properly?
>
> Sure.

Fixed thus.

> So one of the questions: can one rely on current branch predictions
> algorithms (val < 0, val = 0 false etc.) in the long term?

Err, no. We reserve the right to tweek the predictions, or to replace
them with different heuristics. I'd hope they'd be _generally_ better
heuristics, though the effect on any one particular test might change.

r~

* integrate.c (copy_insn_list): Substitute NOTE_EXPECTED_VALUE.

Index: integrate.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/integrate.c,v
retrieving revision 1.142
diff -c -p -r1.142 integrate.c
*** integrate.c 2001/05/03 16:14:34 1.142
--- integrate.c 2001/05/05 16:54:24
*************** copy_insn_list (insns, map, static_chain
*** 1536,1541 ****
--- 1536,1546 ----
else
NOTE_BLOCK (copy) = *mapped_block_p;
}
+ else if (copy
+ && NOTE_LINE_NUMBER (copy) == NOTE_INSN_EXPECTED_VALUE)
+ NOTE_EXPECTED_VALUE (copy)
+ = copy_rtx_and_substitute (NOTE_EXPECTED_VALUE (insn),
+ map, 0);
}
else
copy = 0;