Skip to content

Commit

Permalink
[Profile] Do not annotate select insts not covered in profile.
Browse files Browse the repository at this point in the history
Fixed PR/30466

llvm-svn: 282009
  • Loading branch information
david-xl committed Sep 20, 2016
1 parent fc0929a commit c736828
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
Expand Up @@ -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) {
Expand Down

0 comments on commit c736828

Please sign in to comment.