diff options
author | Xinliang David Li <davidxl@google.com> | 2016-09-20 20:20:01 +0000 |
---|---|---|
committer | Xinliang David Li <davidxl@google.com> | 2016-09-20 20:20:01 +0000 |
commit | c7368287b74d2d0867e79944b034de974e776e6e (patch) | |
tree | 12b3023fc807df1e1868b58c705bed809aca27ac /llvm/lib/Transforms | |
parent | fc0929adb8517ceb07a27f599bfff6ac5cb0db2f (diff) | |
download | bcm5719-llvm-c7368287b74d2d0867e79944b034de974e776e6e.tar.gz bcm5719-llvm-c7368287b74d2d0867e79944b034de974e776e6e.zip |
[Profile] Do not annotate select insts not covered in profile.
Fixed PR/30466
llvm-svn: 282009
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) { |