Only non-weighted predicates were handled in PPCInstrInfo::insertSelect. Handle the weighted predicates as well.
This latent bug was triggered by r255398, because it added use of the branch-weighted predicates.
While here, switch over an enum instead of an int to get the compiler to enforce totality in the future.
On architectures where isel is not always cheaper than the branch sequence, we need to be careful here. In fact, Kit is already working on code to expand isels late into branches to help the branch predictor do the right thing on P7/P8/etc. Enabling this conversion is good for some cores where isel really is cheap (on the PPC A2 for example), but I highly suspect that for P7/P8/etc. we should just reject the transformation entirely as to not lose the hinting information.
Thus, please either add code (or a FIXME) in canInsertSelect that we should not be converting hinted branches into isels on the P7/P8/etc.
I think the cleanest way to do all this might be to:
switch(getNonHintedPredicate(SelectPred)) {
and in canInsertSelect, we can have: