Codegen: [PPC] Handle weighted comparisons when inserting selects.
authorKyle Butt <kyle+llvm@iteratee.net>
Tue, 12 Jan 2016 21:00:43 +0000 (21:00 +0000)
committerKyle Butt <kyle+llvm@iteratee.net>
Tue, 12 Jan 2016 21:00:43 +0000 (21:00 +0000)
commit703fd28e42c8d84b0b7142164cb60ba19fb11c71
tree4717c18f3db18b2b92799a97a477d68c1062e423
parentb8e08438aa60d3269b942181bc643b48c345c10c
Codegen: [PPC] Handle weighted comparisons when inserting selects.

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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257518 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/PowerPC/PPCInstrInfo.cpp
test/CodeGen/PowerPC/2016-01-07-BranchWeightCrash.ll [new file with mode: 0644]