This branch adds hints for highly biased branches on the PPC architecture. Even in absence of profiling information, LLVM will mark code reaching unreachable terminators and other exceptional control flow constructs as highly unlikely to be reached.
Looks like PPCInstrInfo::SubsumesPredicate also needs to be updated, as does PPCInstrInfo::optimizeCompareInstr (to ignore the hinting bits).
Use an enum for these.
These appear in a command-line -help-hidden list, and this description is uncharacteristically long. Shorten this. "Enable static hinting of branches on ppc" is fine, for example.
Feel free to include a more-verbose description in a comment.
PCC |= (TWeight > FWeight) ? PPC::PRED_TAKEN_HINT : PCC |= PPC::PRED_NOT_TAKEN_HINT;
Should you do something here too?
|713 ↗||(On Diff #40721)|
This might be good for POWER cores, but not for the A2. At least, don't do this when targeting the A2.
Please remember to upload your patches with full context (http://llvm.org/docs/Phabricator.html#requesting-a-review-via-the-web-interface).
A few minor comments, otherwise LGTM.
Please don't make unrelated white-space changes along with functional changes.
Is there further testing you wish to do before enabling this by default? If not, then let's enable it.