This is an archive of the discontinued LLVM Phabricator instance.

[profiling] Remove dead profile name vars after emitting name data
ClosedPublic

Authored by vsk on Feb 13 2017, 6:33 PM.

Details

Summary

The profile name variables passed to counter increment intrinsics are
dead after we emit the finalized name data in llvm_prf_nm. However, we
neglect to erase these name variables. This causes huge size increases
in the
TEXT,__const section as well as slowdowns when linker dead
stripping is disabled. Some affected projects are so massive that they
fail to link on Darwin, because only the small code model is supported.

Fix the issue by throwing away the name constants as soon as we're done
with them.

Testing: check-llvm, check-profile, and check-clang.

There is one change to a clang test case not shown here.

Diff Detail

Repository
rL LLVM

Event Timeline

vsk created this revision.Feb 13 2017, 6:33 PM
davidxl accepted this revision.Feb 13 2017, 8:55 PM

very nice.

LGTM

This revision is now accepted and ready to land.Feb 13 2017, 8:55 PM
This revision was automatically updated to reflect the committed changes.