[PATCH] D45436: [llvm-exegesis] Add a flag to disable libpfm even if present.
Clement Courbet via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 11 00:35:55 PDT 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL329781: [llvm-exegesis] Add a flag to disable libpfm even if present. (authored by courbet, committed by ).
Repository:
rL LLVM
https://reviews.llvm.org/D45436
Files:
llvm/trunk/CMakeLists.txt
llvm/trunk/cmake/config-ix.cmake
llvm/trunk/docs/CMake.rst
llvm/trunk/tools/llvm-exegesis/CMakeLists.txt
llvm/trunk/unittests/tools/llvm-exegesis/CMakeLists.txt
Index: llvm/trunk/CMakeLists.txt
===================================================================
--- llvm/trunk/CMakeLists.txt
+++ llvm/trunk/CMakeLists.txt
@@ -366,6 +366,8 @@
option(LLVM_ENABLE_LIBEDIT "Use libedit if available." ON)
+option(LLVM_ENABLE_LIBPFM "Use libpfm for performance counters if available." ON)
+
option(LLVM_ENABLE_THREADS "Use threads if available." ON)
option(LLVM_ENABLE_ZLIB "Use zlib for compression/decompression if available." ON)
Index: llvm/trunk/unittests/tools/llvm-exegesis/CMakeLists.txt
===================================================================
--- llvm/trunk/unittests/tools/llvm-exegesis/CMakeLists.txt
+++ llvm/trunk/unittests/tools/llvm-exegesis/CMakeLists.txt
@@ -22,7 +22,6 @@
)
target_link_libraries(LLVMExegesisTests PRIVATE LLVMExegesis)
-if(HAVE_LIBPFM)
+if(LLVM_ENABLE_LIBPFM AND HAVE_LIBPFM)
target_link_libraries(LLVMExegesisTests PRIVATE pfm)
endif()
-
Index: llvm/trunk/tools/llvm-exegesis/CMakeLists.txt
===================================================================
--- llvm/trunk/tools/llvm-exegesis/CMakeLists.txt
+++ llvm/trunk/tools/llvm-exegesis/CMakeLists.txt
@@ -10,7 +10,6 @@
add_subdirectory(lib)
target_link_libraries(llvm-exegesis PRIVATE LLVMExegesis)
-if(HAVE_LIBPFM)
+if(LLVM_ENABLE_LIBPFM AND HAVE_LIBPFM)
target_link_libraries(llvm-exegesis PRIVATE pfm)
endif()
-
Index: llvm/trunk/docs/CMake.rst
===================================================================
--- llvm/trunk/docs/CMake.rst
+++ llvm/trunk/docs/CMake.rst
@@ -374,6 +374,11 @@
**LLVM_USE_INTEL_JITEVENTS**:BOOL
Enable building support for Intel JIT Events API. Defaults to OFF.
+**LLVM_ENABLE_LIBPFM**:BOOL
+ Enable building with libpfm to support hardware counter measurements in LLVM
+ tools.
+ Defaults to ON.
+
**LLVM_ENABLE_ZLIB**:BOOL
Enable building with zlib to support compression/uncompression in LLVM tools.
Defaults to ON.
Index: llvm/trunk/cmake/config-ix.cmake
===================================================================
--- llvm/trunk/cmake/config-ix.cmake
+++ llvm/trunk/cmake/config-ix.cmake
@@ -90,13 +90,15 @@
endif()
# Check for libpfm.
-check_library_exists(pfm pfm_initialize "" HAVE_LIBPFM_INITIALIZE)
-if(HAVE_LIBPFM_INITIALIZE)
- check_include_file(perfmon/perf_event.h HAVE_PERFMON_PERF_EVENT_H)
- check_include_file(perfmon/pfmlib.h HAVE_PERFMON_PFMLIB_H)
- check_include_file(perfmon/pfmlib_perf_event.h HAVE_PERFMON_PFMLIB_PERF_EVENT_H)
- if(HAVE_PERFMON_PERF_EVENT_H AND HAVE_PERFMON_PFMLIB_H AND HAVE_PERFMON_PFMLIB_PERF_EVENT_H)
- set(HAVE_LIBPFM 1)
+if (LLVM_ENABLE_LIBPFM)
+ check_library_exists(pfm pfm_initialize "" HAVE_LIBPFM_INITIALIZE)
+ if(HAVE_LIBPFM_INITIALIZE)
+ check_include_file(perfmon/perf_event.h HAVE_PERFMON_PERF_EVENT_H)
+ check_include_file(perfmon/pfmlib.h HAVE_PERFMON_PFMLIB_H)
+ check_include_file(perfmon/pfmlib_perf_event.h HAVE_PERFMON_PFMLIB_PERF_EVENT_H)
+ if(HAVE_PERFMON_PERF_EVENT_H AND HAVE_PERFMON_PFMLIB_H AND HAVE_PERFMON_PFMLIB_PERF_EVENT_H)
+ set(HAVE_LIBPFM 1)
+ endif()
endif()
endif()
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D45436.141953.patch
Type: text/x-patch
Size: 3110 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180411/33e1afcd/attachment.bin>
More information about the llvm-commits
mailing list