[PGO] Exit early if all count values are zero
authorRong Xu <xur@google.com>
Wed, 7 Nov 2018 23:51:20 +0000 (23:51 +0000)
committerRong Xu <xur@google.com>
Wed, 7 Nov 2018 23:51:20 +0000 (23:51 +0000)
commitfb4bcc452c0cfba85b7e5b177727eb8c8f966c58
tree4c56e5c3546d58ff9a5f34f3a5beecd577a5a6d1
parent892bbd3f88b9f44efeb4fa9156e569c188d600f3
[PGO] Exit early if all count values are zero

If all the edge counts for a function are zero, skip count population and
annotation, as nothing will happen. This can save some compile time.

Differential Revision: https://reviews.llvm.org/D54212

llvm-svn: 346370
llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
llvm/test/Transforms/PGOProfile/Inputs/func_entry.proftext [new file with mode: 0644]
llvm/test/Transforms/PGOProfile/func_entry.ll [new file with mode: 0644]