Efficient Profiling in the LLVM Compiler Infrastructure Andreas Neustifter In computer science, profiling is the process of determining the execution frequencies of parts of a program. This can be done by instrumenting the program code with counters that are incremented when a part of the program is executed. This work focused on improving the instrumentation based profiling in LLVM (a compiler infrastructure) by reducing the counters placed in the code as suggested by Ball and Larus [1]. This reduced the number of counters placed by approximately 60% and the profiling overhead by approx. 50%. In addition LLVM was changed to allow profiling data to be used in the code generator, for example the register allocators could benefit by making better spilling decisions. This talk concentrates on the obstacles encountered while implementing this algorithm in a real world production tool and then presents some of the improvements made by showing the most interesting profiling benchmarks. [1] Ball, Thomas, and Larus, James. "Optimally profiling and tracing programs." ACM Trans. Program. Lang. Syst. 16, No. 4 (1994): 1319-1360.