[Profile] Do not annotate select insts not covered in profile.

Fixed PR/30466

llvm-svn: 282009
This commit is contained in:
Xinliang David Li 2016-09-20 20:20:01 +00:00
parent fc0929adb8
commit c7368287b7
1 changed files with 2 additions and 1 deletions

View File

@ -967,7 +967,8 @@ void SelectInstVisitor::annotateOneSelectInst(SelectInst &SI) {
// False Count
SCounts[1] = (TotalCount > SCounts[0] ? TotalCount - SCounts[0] : 0);
uint64_t MaxCount = std::max(SCounts[0], SCounts[1]);
setProfMetadata(F.getParent(), &SI, SCounts, MaxCount);
if (MaxCount)
setProfMetadata(F.getParent(), &SI, SCounts, MaxCount);
}
void SelectInstVisitor::visitSelectInst(SelectInst &SI) {