[llvm-commits] CVS: llvm/lib/Reoptimizer/Inst/rtl/Makefile pprtl.cpp pprtl.h
Joel Stanley
jstanley at cs.uiuc.edu
Thu May 22 08:10:07 PDT 2003
Changes in directory llvm/lib/Reoptimizer/Inst/rtl:
Makefile added (r1.1)
pprtl.cpp added (r1.1)
pprtl.h added (r1.1)
---
Log message:
Added rtl/ directory for the runtime lib and performance primitive "metric
library".
---
Diffs of the changes:
Index: llvm/lib/Reoptimizer/Inst/rtl/Makefile
diff -c /dev/null llvm/lib/Reoptimizer/Inst/rtl/Makefile:1.1
*** /dev/null Thu May 22 08:09:10 2003
--- llvm/lib/Reoptimizer/Inst/rtl/Makefile Thu May 22 08:08:58 2003
***************
*** 0 ****
--- 1,5 ----
+ LEVEL = ../../../..
+ LIBRARYNAME = pprtl
+ BUILD_ARCHIVE = 1
+
+ include $(LEVEL)/Makefile.common
Index: llvm/lib/Reoptimizer/Inst/rtl/pprtl.cpp
diff -c /dev/null llvm/lib/Reoptimizer/Inst/rtl/pprtl.cpp:1.1
*** /dev/null Thu May 22 08:09:10 2003
--- llvm/lib/Reoptimizer/Inst/rtl/pprtl.cpp Thu May 22 08:08:59 2003
***************
*** 0 ****
--- 1,31 ----
+ // Implementation of the performance primtive runtime library / "library of metrics"
+
+ #include "pprtl.h"
+
+ void pp_elapsed_time_start(double* retVal)
+ {
+ struct timeval tv;
+ gettimeofday(&tv, 0);
+ printf("pp_elapsed_time_start invoked!\n");
+ printf("address of return value is: 0x%lx\n", (unsigned long) retVal);
+ fflush(stdout);
+
+ // return result in ms
+ *retVal = (tv.tv_sec * 1000000 + tv.tv_usec) / 1000.0;
+ printf("pp_elasped_time_start returning %f\n", *retVal);
+ }
+
+ void pp_elapsed_time_end(double* retVal, double* start)
+ {
+ struct timeval tv;
+ double end;
+
+ printf("pp_elapsed_time_end invoked!\n");
+ printf("Address of start is 0x%lx, value is %f\n", (unsigned long) start, *start);
+ fflush(stdout);
+
+ gettimeofday(&tv, 0);
+ end = (tv.tv_sec * 1000000 + tv.tv_usec) / 1000.0; // convert to ms
+ *retVal = end - *start; // compute diff
+ printf("pp_elapsed_time_end returning %f\n", *retVal);
+ }
Index: llvm/lib/Reoptimizer/Inst/rtl/pprtl.h
diff -c /dev/null llvm/lib/Reoptimizer/Inst/rtl/pprtl.h:1.1
*** /dev/null Thu May 22 08:09:10 2003
--- llvm/lib/Reoptimizer/Inst/rtl/pprtl.h Thu May 22 08:08:59 2003
***************
*** 0 ****
--- 1,25 ----
+ // The standard header for the performance primitive "runtime/metric library"
+
+ #ifndef _INCLUDED_PPLIB_H
+ #define _INCLUDED_PPLIB_H
+
+ #include <sys/time.h>
+ #include <stdio.h>
+
+ extern "C" {
+
+ // library functions
+
+ long pp_timestamp(void);
+ void pp_elapsed_time_start(double* retVal);
+ void pp_elapsed_time_end(double* retVal, double* start);
+ unsigned pp_counterPrim(void);
+
+ // significant functions
+
+ void pp_regionPair(void*, void*);
+ void pp_metricSpec(void*);
+
+ }
+
+ #endif // _INCLUDED_PPLIB_H
More information about the llvm-commits
mailing list