condjump_branch_edge
Jan Hubicka
jh@suse.cz
Sun May 14 13:57:00 GMT 2000
>
> I don't know that it has any meaning. What does it mean
> to have a "taken" branch when the branch *always* goes
> somewhere else? What's the "taken" edge for a switch?
What I am after are jumps like:
(if_then_else (cond) (label 1) (label 2))
>
> > Hmm, I think this will make my life quite hard.
>
> Not at all. You want the edge for the taken branch? Simple:
> identify that there are exactly two outgoing edges from a
> block, and that one of them is marked FALLTHRU. The other is
> the taken edge.
I've done this already, but then got number of misspredicts, because
of jumps like:
(if_then_else (cond) (pc) (label 2))
(these exitst on i386, see jcc_2 versus jcc_3 pattern)
I am not sure what is our notion of BR_PROB here, but my feeling
was that BR_PROB says probability of the condition to be true,
so it works in reversed for such jumps.
I see, perhaps it is cleaner to make BR_PROB mean
probability of actually taking a branch even in such reversed patterns.
I was trying to follow this patch originally, but it requires quite a lot
changes everywhere (you need to examine jump and inverse condition when
needed) and then BR_PROB is not very well defined for two way branches
mentioned above, but I see probably don't want to handle them, as wee
don't handle tablejumps.
Honza
>
> There's no need to examine the jump insn at all.
>
>
> r~
More information about the Gcc-patches
mailing list