Hi Honza, I wasn't sure what to do here so I figured I'd ask.
In adding support for multiple exits to the vectorizer I didn't know how to update this bit: https://github.com/gcc-mirror/gcc/blob/master/gcc/tree-vect-loop-manip.cc#L3363 Essentially, if skip_vector (i.e. not enough iteration to enter the vector loop) then the previous code would update the new probability to be the same as that of the exit edge. This made sense because that's the only edge which could bring you to the next loop preheader. With multiple exits this is no longer the case since any exit can bring you to the Preaheader node. I figured the new counts should simply be the sum of all exit edges. But that gives quite large count values compared to the rest of the loop. I then thought I would need to scale the counts by the probability of the edge being taken. The problem here is that the probabilities don't end up to 100% so the scaled counts also looked kinda wonkey. Any suggestions? If you want some small examples to look at, testcases ./gcc/testsuite/gcc.dg/vect/vect-early-break_90.c to ./gcc/testsuite/gcc.dg/vect/vect-early-break_93.c should be relevant here. Thanks, Tamar