News for hackers. Stuff that matters.
Re:Understanding CPU port contention by dendibakh on Friday March 23, 2018 @07:04PM (#16663424)
Well, yeah. I don't know much about the current state of the art (because I don't touch the CodeGen on a daily basis), but I kind of look into the future with hope that compilers will better handle at least those "simple" cases. :)
Re:Understanding CPU port contention by BeeOnRope on Saturday March 24, 2018 @12:02AM (#16664796)
Compilers are rarely going to transform the 1000/1000 example into the 10/10 one, even if they were smarter.

Often such a transformation is simply impossible: the effect of interleaving the instructions may be different than what the source dictates.

Also the 1000/1000 example probably doesn't arise as a long stream of explicit instructions: it is probably just a short loop with 1000 iterations! That makes it even less likely that the compiler will simply start interleaving various instructions following the loop into the loop body somehow.