[PATCH] D35801: [PowerPC] enable optimizeCompareInstr for branch with static branch hint
Nemanja Ivanovic via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 25 03:39:36 PDT 2017
nemanjai accepted this revision.
nemanjai added a comment.
This revision is now accepted and ready to land.
Just a couple of minor nits to add comments aiding readability. Other than that, LGTM.
Comment at: lib/Target/PowerPC/PPCInstrInfo.cpp:1644
+ PPC::Predicate Pred = (PPC::Predicate)UseMI->getOperand(0).getImm();
+ unsigned PredCond = PPC::getPredicateCondition(Pred);
+ if (PredCond != PPC::PRED_EQ && PredCond != PPC::PRED_NE)
`// Ignore hint bits when checking for non-equality comparisons.`
Comment at: lib/Target/PowerPC/PPCInstrInfo.cpp:1693
// The record-form instructions set CR bit based on signed comparison against 0.
// We try to convert a compare against 1 or -1 into a compare against 0.
bool Success = false;
Please add a note that the existing hint is propagated to the updated hint (or something along those lines). I think that it isn't immediately obvious to the reader what is happening here.
More information about the llvm-commits