File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
llvm/lib/Transforms/Instrumentation Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -562,13 +562,15 @@ bool InstrProfiling::run(
562
562
if (NeedsRuntimeHook)
563
563
MadeChange = emitRuntimeHook ();
564
564
565
- // Improve compile time by avoiding linear scans when there is no work.
566
565
GlobalVariable *CoverageNamesVar =
567
566
M.getNamedGlobal (getCoverageUnusedNamesVarName ());
568
- if (!containsProfilingIntrinsics (M)) {
569
- if (!CoverageNamesVar || !NeedsRuntimeHook) {
570
- return MadeChange;
571
- }
567
+ // Improve compile time by avoiding linear scans when there is no work.
568
+ // When coverage is enabled on code that is eliminated by the front-end,
569
+ // e.g. unused functions with internal linkage, and the target does not
570
+ // require pulling in profile runtime, there is no need to do further work.
571
+ if (!containsProfilingIntrinsics (M) &&
572
+ (!CoverageNamesVar || !NeedsRuntimeHook)) {
573
+ return MadeChange;
572
574
}
573
575
574
576
// We did not know how many value sites there would be inside
You can’t perform that action at this time.
0 commit comments