[llvm] [InstrProf] Do not block functions from PGOUse (PR #71106)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 2 13:29:55 PDT 2023
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-pgo
Author: Ellis Hoag (ellishg)
<details>
<summary>Changes</summary>
The `skipPGO()` function was added in https://reviews.llvm.org/D137184. Unfortunately, it also blocked functions from being annotated (PGOUse), which I believe will cause confusion to users if a function has a profile but it is not PGO'd.
The docs for `noprofile` and `skipprofile` only claim to block instrumentation, not PGO optimization: https://llvm.org/docs/LangRef.html
---
Full diff: https://github.com/llvm/llvm-project/pull/71106.diff
1 Files Affected:
- (modified) llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp (+2-2)
``````````diff
diff --git a/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp b/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
index 7ad1c9bc54f3780..1474ccc2b978fd8 100644
--- a/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
+++ b/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
@@ -1760,7 +1760,7 @@ static void collectComdatMembers(
ComdatMembers.insert(std::make_pair(C, &GA));
}
-// Don't perform PGO instrumeatnion / profile-use.
+// Return true if we should skip instrumenting this function
static bool skipPGO(const Function &F) {
if (F.isDeclaration())
return true;
@@ -2031,7 +2031,7 @@ static bool annotateAllFunctions(
InstrumentFuncEntry = PGOInstrumentEntry;
bool HasSingleByteCoverage = PGOReader->hasSingleByteCoverage();
for (auto &F : M) {
- if (skipPGO(F))
+ if (F.isDeclaration())
continue;
auto &TLI = LookupTLI(F);
auto *BPI = LookupBPI(F);
``````````
</details>
https://github.com/llvm/llvm-project/pull/71106
More information about the llvm-commits
mailing list