aboutsummaryrefslogtreecommitdiffstats
path: root/runtime/libprofile/BasicBlockTracing.c
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2013-10-02 15:42:23 +0000
committerChandler Carruth <chandlerc@gmail.com>2013-10-02 15:42:23 +0000
commitdd5d86d992eb129ecd0bb013d2db2d6a0e8d2605 (patch)
treee408dd567e473235623fc853b5b993ea47cf0ce4 /runtime/libprofile/BasicBlockTracing.c
parent6ffce6fa9295699078f81fabb9ca32f6f22bdf09 (diff)
downloadexternal_llvm-dd5d86d992eb129ecd0bb013d2db2d6a0e8d2605.tar.gz
external_llvm-dd5d86d992eb129ecd0bb013d2db2d6a0e8d2605.tar.bz2
external_llvm-dd5d86d992eb129ecd0bb013d2db2d6a0e8d2605.zip
Remove the very substantial, largely unmaintained legacy PGO
infrastructure. This was essentially work toward PGO based on a design that had several flaws, partially dating from a time when LLVM had a different architecture, and with an effort to modernize it abandoned without being completed. Since then, it has bitrotted for several years further. The result is nearly unusable, and isn't helping any of the modern PGO efforts. Instead, it is getting in the way, adding confusion about PGO in LLVM and distracting everyone with maintenance on essentially dead code. Removing it paves the way for modern efforts around PGO. Among other effects, this removes the last of the runtime libraries from LLVM. Those are being developed in the separate 'compiler-rt' project now, with somewhat different licensing specifically more approriate for runtimes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191835 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'runtime/libprofile/BasicBlockTracing.c')
-rw-r--r--runtime/libprofile/BasicBlockTracing.c67
1 files changed, 0 insertions, 67 deletions
diff --git a/runtime/libprofile/BasicBlockTracing.c b/runtime/libprofile/BasicBlockTracing.c
deleted file mode 100644
index 0815e2e516..0000000000
--- a/runtime/libprofile/BasicBlockTracing.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/*===-- BasicBlockTracing.c - Support library for basic block tracing -----===*\
-|*
-|* The LLVM Compiler Infrastructure
-|*
-|* This file is distributed under the University of Illinois Open Source
-|* License. See LICENSE.TXT for details.
-|*
-|*===----------------------------------------------------------------------===*|
-|*
-|* This file implements the call back routines for the basic block tracing
-|* instrumentation pass. This should be used with the -trace-basic-blocks
-|* LLVM pass.
-|*
-\*===----------------------------------------------------------------------===*/
-
-#include "Profiling.h"
-#include <stdlib.h>
-#include <stdio.h>
-
-static unsigned *ArrayStart, *ArrayEnd, *ArrayCursor;
-
-/* WriteAndFlushBBTraceData - write out the currently accumulated trace data
- * and reset the cursor to point to the beginning of the buffer.
- */
-static void WriteAndFlushBBTraceData () {
- write_profiling_data(BBTraceInfo, ArrayStart, (ArrayCursor - ArrayStart));
- ArrayCursor = ArrayStart;
-}
-
-/* BBTraceAtExitHandler - When the program exits, just write out any remaining
- * data and free the trace buffer.
- */
-static void BBTraceAtExitHandler(void) {
- WriteAndFlushBBTraceData ();
- free (ArrayStart);
-}
-
-/* llvm_trace_basic_block - called upon hitting a new basic block. */
-void llvm_trace_basic_block (unsigned BBNum) {
- *ArrayCursor++ = BBNum;
- if (ArrayCursor == ArrayEnd)
- WriteAndFlushBBTraceData ();
-}
-
-/* llvm_start_basic_block_tracing - This is the main entry point of the basic
- * block tracing library. It is responsible for setting up the atexit
- * handler and allocating the trace buffer.
- */
-int llvm_start_basic_block_tracing(int argc, const char **argv,
- unsigned *arrayStart, unsigned numElements) {
- int Ret;
- const unsigned BufferSize = 128 * 1024;
- unsigned ArraySize;
-
- Ret = save_arguments(argc, argv);
-
- /* Allocate a buffer to contain BB tracing data */
- ArraySize = BufferSize / sizeof (unsigned);
- ArrayStart = malloc (ArraySize * sizeof (unsigned));
- ArrayEnd = ArrayStart + ArraySize;
- ArrayCursor = ArrayStart;
-
- /* Set up the atexit handler. */
- atexit (BBTraceAtExitHandler);
-
- return Ret;
-}