[llvm] r283579 - [LoopIdiomRecognize] Merge two if conditions into one. NFCI.
Davide Italiano via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 7 11:39:44 PDT 2016
Author: davide
Date: Fri Oct 7 13:39:43 2016
New Revision: 283579
URL: http://llvm.org/viewvc/llvm-project?rev=283579&view=rev
Log:
[LoopIdiomRecognize] Merge two if conditions into one. NFCI.
Modified:
llvm/trunk/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopIdiomRecognize.cpp?rev=283579&r1=283578&r2=283579&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopIdiomRecognize.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopIdiomRecognize.cpp Fri Oct 7 13:39:43 2016
@@ -1181,9 +1181,7 @@ bool LoopIdiomRecognize::recognizePopcou
// It should have a preheader containing nothing but an unconditional branch.
BasicBlock *PH = CurLoop->getLoopPreheader();
- if (!PH)
- return false;
- if (&PH->front() != PH->getTerminator())
+ if (!PH || &PH->front() != PH->getTerminator())
return false;
auto *EntryBI = dyn_cast<BranchInst>(PH->getTerminator());
if (!EntryBI || EntryBI->isConditional())
More information about the llvm-commits
mailing list