Index: lib/IR/Function.cpp =================================================================== --- lib/IR/Function.cpp +++ lib/IR/Function.cpp @@ -1262,7 +1262,10 @@ if (MDString *MDS = dyn_cast(MD->getOperand(0))) if (MDS->getString().equals("function_entry_count")) { ConstantInt *CI = mdconst::extract(MD->getOperand(1)); - return CI->getValue().getZExtValue(); + uint64_t Count = CI->getValue().getZExtValue(); + if(Count == 0) + return None; + return Count; } return None; }