Skip to content

Commit

Permalink
Removing dependency on third party library for Intel JIT event support.
Browse files Browse the repository at this point in the history
Patch committed on behalf of Kirill Uhanov

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164831 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
andykaylor committed Sep 28, 2012
1 parent 07b4d55 commit 770b97b
Show file tree
Hide file tree
Showing 15 changed files with 1,285 additions and 376 deletions.
18 changes: 1 addition & 17 deletions CMakeLists.txt
Expand Up @@ -177,23 +177,7 @@ option(LLVM_USE_INTEL_JITEVENTS

if( LLVM_USE_INTEL_JITEVENTS )
# Verify we are on a supported platform
if( CMAKE_SYSTEM_NAME MATCHES "Windows" OR CMAKE_SYSTEM_NAME MATCHES "Linux" )
# Directory where Intel Parallel Amplifier XE 2011 is installed.
if ( WIN32 )
set(LLVM_INTEL_JITEVENTS_DIR $ENV{VTUNE_AMPLIFIER_XE_2011_DIR})
else ( WIN32 )
set(LLVM_INTEL_JITEVENTS_DIR "/opt/intel/vtune_amplifier_xe_2011")
endif ( WIN32 )

# Set include and library search paths for Intel JIT Events API
set(LLVM_INTEL_JITEVENTS_INCDIR "${LLVM_INTEL_JITEVENTS_DIR}/include")

if ( CMAKE_SIZEOF_VOID_P EQUAL 8 )
set(LLVM_INTEL_JITEVENTS_LIBDIR "${LLVM_INTEL_JITEVENTS_DIR}/lib64")
else ( CMAKE_SIZEOF_VOID_P EQUAL 8 )
set(LLVM_INTEL_JITEVENTS_LIBDIR "${LLVM_INTEL_JITEVENTS_DIR}/lib32")
endif ( CMAKE_SIZEOF_VOID_P EQUAL 8 )
else()
if( NOT CMAKE_SYSTEM_NAME MATCHES "Windows" AND NOT CMAKE_SYSTEM_NAME MATCHES "Linux" )
message(FATAL_ERROR
"Intel JIT API support is available on Linux and Windows only.")
endif()
Expand Down
43 changes: 10 additions & 33 deletions autoconf/configure.ac
Expand Up @@ -1290,46 +1290,23 @@ AC_DEFINE_UNQUOTED([LLVM_USE_OPROFILE],$USE_OPROFILE,

dnl Enable support for Intel JIT Events API.
AC_ARG_WITH(intel-jitevents,
AS_HELP_STRING([--with-intel-jitevents=<vtune-amplifier-dir>],
[Specify location of run-time support library for Intel JIT API (default=/opt/intel/vtune_amplifier_xe_2011)]),
AS_HELP_STRING([--with-intel-jitevents Notify Intel JIT profiling API of generated code]),
[
case "$withval" in
yes) AC_SUBST(USE_INTEL_JITEVENTS,[1]);;
no) AC_SUBST(USE_INTEL_JITEVENTS,[0]);;
*) AC_MSG_ERROR([Invalid setting for --with-intel-jitevents. Use "yes" or "no"]);;
esac
case $llvm_cv_os_type in
Linux|Win32|Cygwin|MingW) ;;
*)
AC_MSG_ERROR([
Intel JIT API support is available on Linux and Windows only."]) ;;
*) AC_MSG_ERROR([Intel JIT API support is available on Linux and Windows only.]);;
esac
AC_SUBST(USE_INTEL_JITEVENTS, [1])
case "$llvm_cv_target_arch" in
x86) llvm_intel_jitevents_archdir="lib32";;
x86_64) llvm_intel_jitevents_archdir="lib64";;
*) echo "Target architecture $llvm_cv_target_arch does not support Intel JIT Events API"
exit -1;;
esac
INTEL_JITEVENTS_INCDIR="/opt/intel/vtune_amplifier_xe_2011/include"
INTEL_JITEVENTS_LIBDIR="/opt/intel/vtune_amplifier_xe_2011/$llvm_intel_jitevents_archdir"
case "$withval" in
/* | [[A-Za-z]]:[[\\/]]*) INTEL_JITEVENTS_INCDIR=$withval/include
INTEL_JITEVENTS_LIBDIR=$withval/$llvm_intel_jitevents_archdir ;;
*) ;;
x86|x86_64) ;;
*) AC_MSG_ERROR([Target architecture $llvm_cv_target_arch does not support Intel JIT Events API.]);;
esac
AC_SUBST(INTEL_JITEVENTS_INCDIR)
AC_SUBST(INTEL_JITEVENTS_LIBDIR)
LIBS="$LIBS -L${INTEL_JITEVENTS_LIBDIR}"
CPPFLAGS="$CPPFLAGS -I$INTEL_JITEVENTS_INCDIR"
AC_SEARCH_LIBS(iJIT_IsProfilingActive, jitprofiling, [], [
echo "Error! Cannot find libjitprofiling.a. Please check path specified in flag --with-intel-jitevents"
exit -1
])
AC_CHECK_HEADER([jitprofiling.h], [], [
echo "Error! Cannot find jitprofiling.h. Please check path specified in flag --with-intel-jitevents"
exit -1
])
],
[
AC_SUBST(USE_INTEL_JITEVENTS, [0])
Expand Down

0 comments on commit 770b97b

Please sign in to comment.