Commit 07d3afaa authored by Wei Pan's avatar Wei Pan Committed by gbsbuild

Do not build schedulers as a library as it is not a useful standalone

library. This removes circular dependencies while creating dlls

Change-Id: I9276f43cca4c744fe6a3316b13aae7e5d8607920
parent 3bb520c8
......@@ -3421,8 +3421,6 @@ set(IGC_BUILD__PROJ_LABEL__igc_lib "${IGC_BUILD__PROJ__igc_lib}")
set(IGC_BUILD__PROJ_LABEL__GenX_IR "${IGC_BUILD__PROJ_NAME_PREFIX}vISA")
set(IGC_BUILD__PROJ_LABEL__LocalScheduler "${IGC_BUILD__PROJ_NAME_PREFIX}LocalScheduler")
add_subdirectory(common)
igc_sg_define(IGC__common)
igc_sg_define(IGC__Common_CLElfLib)
......@@ -3637,11 +3635,10 @@ unset(_cpuSuffix)
# Injecting external vISA project.
add_subdirectory("${IGC_BUILD__VISA_DIR}" visa)
set_property(TARGET "GenX_IR" "LocalScheduler" APPEND PROPERTY COMPILE_DEFINITIONS
set_property(TARGET "GenX_IR" APPEND PROPERTY COMPILE_DEFINITIONS
${IGC_BUID__VISA_COMPILE_DEFINITIONS}
)
set_property(TARGET "GenX_IR" PROPERTY PROJECT_LABEL "${IGC_BUILD__PROJ_LABEL__GenX_IR}")
set_property(TARGET "LocalScheduler" PROPERTY PROJECT_LABEL "${IGC_BUILD__PROJ_LABEL__LocalScheduler}")
set_property(TARGET "GenX_IR" PROPERTY PROJECT_LABEL "${IGC_BUILD__PROJ_LABEL__GenX_IR}")
# =================================== Link targets and dependencies ====================================
......
......@@ -73,10 +73,6 @@ if (IGC_BUILD)
endif (IGC_BUILD)
# Common library used by the shared libraries in this file (a sub directory of this directory hence
# invoked from here)
add_subdirectory(LocalScheduler)
if(BS_USE_OSDM_BUILD_SYSTEM)
include(${BUILD_SYS_INC}/utils.cmake)
# Locate bison and flex using common bs macro
......@@ -159,6 +155,19 @@ include_directories(${Jitter_inc_dirs})
# (due to the fact that they are .c files rather than .cpp)
set_source_files_properties( CISA.tab.c lex.CISA.c PROPERTIES LANGUAGE CXX )
set(LocalScheduler_SOURCES
LocalScheduler/Dependencies_G4IR.cpp
LocalScheduler/G4_Sched.cpp
LocalScheduler/LatencyTable.cpp
LocalScheduler/LocalScheduler_G4IR.cpp
)
set(LocalScheduler_HEADERS
LocalScheduler/Dependencies_G4IR.h
LocalScheduler/LatencyTable.h
LocalScheduler/LocalScheduler_G4IR.h
)
# Set up some common source files used in all the projects so they only need to be defined once
set(GenX_Common_Sources_External
BinaryCISAEmission.cpp
......@@ -196,6 +205,7 @@ set(GenX_Common_Sources_External
SpillCleanup.cpp
Rematerialization.cpp
RPE.cpp
${LocalScheduler_SOURCES}
)
set(GenX_Common_Sources
......@@ -275,6 +285,7 @@ set(GenX_Common_Headers
Metadata.h
RPE.h
include/gtpin_IGC_interface.h
${LocalScheduler_HEADERS}
)
set(GenX_CISA_dis_Common_Headers
common.h
......@@ -340,7 +351,7 @@ if (UNIX OR WIN32)
source_group("Utility Files" FILES ${GenX_IR_EXE_UTILITY} )
source_group("Header Files" FILES ${GenX_IR_EXE_HEADERS} )
source_group("Lex Yacc Files" FILES ${GenX_IR_EXE_lex_yacc} )
target_link_libraries(GenX_IR_Exe LocalScheduler IGA_SLIB IGA_ENC_LIB)
target_link_libraries(GenX_IR_Exe IGA_SLIB IGA_ENC_LIB)
if (ANDROID AND MEDIA_IGA)
target_link_libraries(GenX_IR_Exe c++_static)
endif(ANDROID AND MEDIA_IGA)
......@@ -405,7 +416,7 @@ endif (NOT IGC_BUILD)
# ###############################################################
# GenX_IR (dll)
# ###############################################################
link_directories(${libGenX_IR_BINARY_DIR}/LocalScheduler)
set(GenX_IR_DLL_SOURCES
${GenX_Common_Sources}
${GenX_CISA_dis_Common_Sources}
......@@ -449,10 +460,10 @@ if (IGC_BUILD)
)
set_target_properties( GenX_IR PROPERTIES OUTPUT_NAME "igfxcmjit${TARGET_MODIFIER}")
if(WIN32)
target_link_libraries(GenX_IR LocalScheduler ${GCC_SECURE_LINK_FLAGS} IGA_ENC_LIB IGA_SLIB)
target_link_libraries(GenX_IR ${GCC_SECURE_LINK_FLAGS} IGA_ENC_LIB IGA_SLIB)
add_dependencies(GenX_IR IGA_DLL)
else()
target_link_libraries(GenX_IR LocalScheduler ${GCC_SECURE_LINK_FLAGS} IGA_ENC_LIB IGA_SLIB)
target_link_libraries(GenX_IR ${GCC_SECURE_LINK_FLAGS} IGA_ENC_LIB IGA_SLIB)
add_dependencies(GenX_IR IGA_DLL)
endif(WIN32)
endif (IGC_BUILD)
......
# This file sets up the following libraries and executables:
# Target name | CMake project name | Supported Platforms
#------------------------------+------------------------------------+---------------------------
# LocalSheduler.lib | LocalScheduler | Windows
# libLocalScheduler.a | LocalScheduler | Linux, Android
if(WIN32)
cmake_minimum_required(VERSION 3.1)
cmake_policy(SET CMP0043 OLD)
else()
cmake_minimum_required(VERSION 2.8)
endif(WIN32)
# Set up windows mobile build flags to use dynamic multi-threaded runtime (/MD)
# Set up windows(other) build flags to use static multi-threaded runtime (/MT)
win_static_runtime()
# ###############################################################
# LocalScheduler (lib)
# ###############################################################
include_directories(../include)
if(ANDROID AND MEDIA_IGA)
set(NDK_Libstdcxx $ENV{ANDROID_NDK}/sources/cxx-stl/llvm-libc++/libcxx)
set(Extra_Android_Inc ${NDK_Libstdcxx}/include ${ANDROID_NDK}/sources/android/support/include
${NDK_Libstdcxx}/include/backward)
include_directories(${Extra_Android_Inc})
endif(ANDROID AND MEDIA_IGA)
set(LocalScheduler_SOURCES
Dependencies_G4IR.cpp
LocalScheduler_G4IR.cpp
LatencyTable.cpp
G4_Sched.cpp)
set(LocalScheduler_HEADERS
Dependencies_G4IR.h
LatencyTable.h
LocalScheduler_G4IR.h)
if (WIN32 AND NOT IGC_BUILD)
add_compile_options(/WX)
endif (WIN32 AND NOT IGC_BUILD)
#disable exceptions, windows only for now
if(WIN32)
string(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
add_definitions(-D_HAS_EXCEPTIONS=0)
endif()
add_library(LocalScheduler ${LocalScheduler_SOURCES} ${LocalScheduler_HEADERS})
if(IGC_BUILD AND MSVC)
#set up standard defines from the common WDK path.
bs_set_wdk(LocalScheduler)
endif()
add_dependencies(LocalScheduler check_headers)
source_group("Header Files" FILES ${LocalScheduler_HEADERS})
if( WIN32 AND ("${BUILD_WINDOWS_MOBILE}" STREQUAL "TRUE") )
set_target_properties( LocalScheduler PROPERTIES COMPILE_DEFINITIONS _ATL_NO_WIN_SUPPORT )
endif()
#ifndef MUL_INTEGER_EXTRA_LATENCY
#define MUL_INTEGER_EXTRA_LATENCY 0
#endif
// TOTAL_LATENCY = LATENCY + OCCUPANCY
//
// OPCODE, LATENCY, OCCUPANCY
DEF_INSTR_LATENCY(G4_add, (14-2), 2)
DEF_INSTR_LATENCY(G4_mul, (14-2), 2)
DEF_INSTR_LATENCY(G4_bfe, (14-4), 4)
DEF_INSTR_LATENCY(G4_bfi1, (14-4), 4)
DEF_INSTR_LATENCY(G4_bfi2, (14-4), 4)
DEF_INSTR_LATENCY(G4_bfrev, (14-4), 4)
DEF_INSTR_LATENCY(G4_cbit, (14-4), 4)
DEF_INSTR_LATENCY(G4_dp2, (14-4), 4)
DEF_INSTR_LATENCY(G4_dp3, (14-4), 4)
DEF_INSTR_LATENCY(G4_dp4, (14-4), 4)
DEF_INSTR_LATENCY(G4_dph, (14-4), 4)
DEF_INSTR_LATENCY(G4_fbh, (14-4), 4)
DEF_INSTR_LATENCY(G4_fbl, (14-4), 4)
DEF_INSTR_LATENCY(G4_lrp, (14-4), 4)
DEF_INSTR_LATENCY(G4_mac, (14-4), 4)
DEF_INSTR_LATENCY(G4_mach, (14-4), 4)
DEF_INSTR_LATENCY(G4_pln, (14-4), 4)
DEF_MATH_LATENCY(MATH_INV, (22-4), 4)
DEF_MATH_LATENCY(MATH_LOG, (22-4), 4)
DEF_MATH_LATENCY(MATH_EXP, (22-4), 4)
DEF_MATH_LATENCY(MATH_SQRT, (22-4), 4)
DEF_MATH_LATENCY(MATH_RSQ, (22-4), 4)
DEF_MATH_LATENCY(MATH_SIN, (22-4), 4)
DEF_MATH_LATENCY(MATH_COS, (22-4), 4)
DEF_MATH_LATENCY(MATH_FDIV, (30-8), 8)
DEF_MATH_LATENCY(MATH_POW, (30-8), 8)
DEF_MATH_LATENCY(MATH_INT_DIV, (22-4), 4)
DEF_MATH_LATENCY(MATH_INT_DIV_QUOT, (22-4), 4)
DEF_MATH_LATENCY(MATH_INT_DIV_REM, (22-4), 4)
DEF_MATH_LATENCY(MATH_INVM, (22-4), 4)
DEF_SEND_LATENCY(SFID_NULL, (50-2), 2)
DEF_SEND_LATENCY(SFID_SAMPLER, (300-2), 2)
DEF_SEND_LATENCY(SFID_GATEWAY, (200-2), 2)
DEF_SEND_LATENCY(SFID_DP_DC2, (400-2), 2)
DEF_SEND_LATENCY(SFID_DP_WRITE, (200-2), 2)
DEF_SEND_LATENCY(SFID_URB, (50-2), 2)
DEF_SEND_LATENCY(SFID_SPAWNER, (50-2), 2)
DEF_SEND_LATENCY(SFID_VME, (50-2), 2)
DEF_SEND_LATENCY(SFID_DP_CC, (60-2), 2)
DEF_SEND_LATENCY(SFID_DP_DC, (400-2), 2)
DEF_SEND_LATENCY(SFID_DP_PI, (50-2), 2)
DEF_SEND_LATENCY(SFID_DP_DC1, (400-2), 2)
DEF_SEND_LATENCY(SFID_CRE, (200-2), 2)
DEF_SEND_LATENCY(SFID_NUM, (200-2), 2)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment