diff options
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp b/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp index bff155c1d67..4f333d61810 100644 --- a/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp +++ b/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp @@ -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) { |