> Enabling BB-reorder only if profile info is available, is not the > right way to go. The compiler really doesn't place blocks in sane > places without it -- and it shouldn't have to, either. For example if > you split an edge at some point, the last thing you want to worry > about, is where the new basic block is going to end up. > > There are actually a few bugs in Bugzilla about BB-reorder, FWIW.
I've done a few searches in Bugzilla and am not sure if I have found the BB reorder bugs you are referring to. The ones I have found are: 16797: Opportunity to remove unnecessary load instructions 41396: missed space optimization related to basic block reorder 21002: RTL prologue and basic-block reordering pessimizes delay-slot filling. (If you can recall any others, I'd appreciate hearing of them.) Based on 41396, it looks like BB reorder is disabled for -Os. But you said in your post above that "the compiler really doesn't place blocks in sane places without it", so does that mean that we could probably increase performance for -Os if BB reorder was (improved) and enabled for -Os? Cheers, Ian