diff --git a/llvm/lib/Analysis/BranchProbabilityInfo.cpp b/llvm/lib/Analysis/BranchProbabilityInfo.cpp --- a/llvm/lib/Analysis/BranchProbabilityInfo.cpp +++ b/llvm/lib/Analysis/BranchProbabilityInfo.cpp @@ -882,7 +882,7 @@ // we don't have information about probabilities. if (Instruction *LHS = dyn_cast(CI->getOperand(0))) if (LHS->getOpcode() == Instruction::And) - if (ConstantInt *AndRHS = dyn_cast(LHS->getOperand(1))) + if (ConstantInt *AndRHS = GetConstantInt(LHS->getOperand(1))) if (AndRHS->getValue().isPowerOf2()) return false;