diff --git a/lib/Transforms/Scalar/LoopIdiomRecognize.cpp b/lib/Transforms/Scalar/LoopIdiomRecognize.cpp index 153fedf2c37..8f929941d59 100644 --- a/lib/Transforms/Scalar/LoopIdiomRecognize.cpp +++ b/lib/Transforms/Scalar/LoopIdiomRecognize.cpp @@ -455,7 +455,7 @@ bool NclPopcountRecognize::detectIdiom(Instruction *&CntInst, continue; PHINode *Phi = dyn_cast(Inst->getOperand(0)); - if (!Phi && Phi->getParent() != LoopEntry) + if (!Phi || Phi->getParent() != LoopEntry) continue; // Check if the result of the instruction is live of the loop.