[llvm] f039a9f - [InstrProfiling] Emit runtime hook only once
Gulfem Savrun Yeniceri via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 20 10:00:58 PDT 2022
Author: Gulfem Savrun Yeniceri
Date: 2022-09-20T17:00:46Z
New Revision: f039a9fa32483a7d4c2de421595fbe295e9cac6a
URL: https://github.com/llvm/llvm-project/commit/f039a9fa32483a7d4c2de421595fbe295e9cac6a
DIFF: https://github.com/llvm/llvm-project/commit/f039a9fa32483a7d4c2de421595fbe295e9cac6a.diff
LOG: [InstrProfiling] Emit runtime hook only once
This patch fixes the issue about calling emitRuntimeHook() twice
when we need to unconditionally emit runtime hook as discussed in
https://reviews.llvm.org/rGd6aed77f0d19.
Differential Revision: https://reviews.llvm.org/D134254
Added:
Modified:
llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp b/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
index ce9972888e892..a0041fc519495 100644
--- a/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
+++ b/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
@@ -567,11 +567,11 @@ bool InstrProfiling::run(
emitVNodes();
emitNameData();
- // Emit runtime hook except for the cases where coverage is enabled on
- // code that is eliminated by the front-end, e.g. unused functions with
- // internal linkage, and the target does not require pulling in profile
- // runtime.
- if (containsProfilingIntrinsics(M) || !CoverageNamesVar || NeedsRuntimeHook)
+ // Emit runtime hook for the cases where the target does not unconditionally
+ // require pulling in profile runtime, and coverage is enabled on code that is
+ // not eliminated by the front-end, e.g. unused functions with internal
+ // linkage.
+ if (!NeedsRuntimeHook && containsProfilingIntrinsics(M))
emitRuntimeHook();
emitRegistration();
More information about the llvm-commits
mailing list