Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
cmd/compile, cmd/internal/obj/ppc64: generate the likely/unlikely bit on branches for ppc64x #17235
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
cmd/compile/internal/ssa/block.go:Block has a branch prediction field (called Likely).
changed the title from
cmd/compile, cmd/internal/obj/ppc64 generate the likely/unlikely bit on branches for ppc64x
cmd/compile, cmd/internal/obj/ppc64: generate the likely/unlikely bit on branches for ppc64x
Oct 3, 2016
I've done some investigation on this, setting the likely bit based on the end of block information. However that does not always provide an improvement, it varies quite a bit and in many cases gets worse. I have not investigated further to try and determine if the information provided is not dependable for ppc64x or if there is some other reason.
If I were to set this at all, I'd prefer to only set it in the obvious cases, such as when there is an if check for a panic condition and then the panic path marked as unlikely. Not sure what the best way is to determine that.
Thanks for the research. I've done the analysis in the past (other languages, other compilers) to do the "this will certainly fail, so it's certainly not a critical path" likeliness check, and I think we could do that here, too.
I have an item on my to-do list to write up a list of little useful projects, and that's one of them.