From 930db249ffbb4c40cbabebb337254647ad40082f Mon Sep 17 00:00:00 2001 From: Compute-Runtime-Validation Date: Wed, 15 Jun 2022 02:11:36 +0200 Subject: [PATCH] Revert "Enable Global Symbol Generation by Default for L0 modules" This reverts commit 9996228281fedc172309356ab47bd26e5cc45c62. Signed-off-by: Compute-Runtime-Validation --- level_zero/core/source/module/module_imp.cpp | 6 +- level_zero/core/source/module/module_imp.h | 2 - .../unit_tests/sources/module/test_module.cpp | 56 ------------------- .../debug_settings/debug_variables_base.inl | 1 - shared/test/common/test_files/igdrcl.config | 1 - 5 files changed, 1 insertion(+), 65 deletions(-) diff --git a/level_zero/core/source/module/module_imp.cpp b/level_zero/core/source/module/module_imp.cpp index aff5b9a3d9..3c711ef8c2 100644 --- a/level_zero/core/source/module/module_imp.cpp +++ b/level_zero/core/source/module/module_imp.cpp @@ -50,7 +50,6 @@ NEO::ConstStringRef greaterThan4GbRequired = "-ze-opt-greater-than-4GB-buffer-re NEO::ConstStringRef hasBufferOffsetArg = "-ze-intel-has-buffer-offset-arg"; NEO::ConstStringRef debugKernelEnable = "-ze-kernel-debug-enable"; NEO::ConstStringRef enableLibraryCompile = "-library-compilation"; -NEO::ConstStringRef enableGlobalVariableSymbols = "-take-global-address"; } // namespace BuildOptions ModuleTranslationUnit::ModuleTranslationUnit(L0::Device *device) @@ -668,7 +667,7 @@ void ModuleImp::createBuildOptions(const char *pBuildFlags, std::string &apiOpti moveBuildOption(internalBuildOptions, apiOptions, NEO::CompilerOptions::greaterThan4gbBuffersRequired, BuildOptions::greaterThan4GbRequired); moveBuildOption(internalBuildOptions, apiOptions, NEO::CompilerOptions::allowZebin, NEO::CompilerOptions::allowZebin); this->libraryExportEnabled = moveBuildOption(apiOptions, apiOptions, BuildOptions::enableLibraryCompile, BuildOptions::enableLibraryCompile); - this->globalExportEnabled = moveBuildOption(apiOptions, apiOptions, BuildOptions::enableGlobalVariableSymbols, BuildOptions::enableGlobalVariableSymbols); + createBuildExtraOptions(apiOptions, internalBuildOptions); } if (NEO::ApiSpecificConfig::getBindlessConfiguration()) { @@ -677,9 +676,6 @@ void ModuleImp::createBuildOptions(const char *pBuildFlags, std::string &apiOpti if (!this->libraryExportEnabled && NEO::DebugManager.flags.EnableProgramSymbolTableGeneration.get()) { NEO::CompilerOptions::concatenateAppend(apiOptions, BuildOptions::enableLibraryCompile.str()); } - if (!this->globalExportEnabled && NEO::DebugManager.flags.EnableGlobalSymbolGeneration.get()) { - NEO::CompilerOptions::concatenateAppend(apiOptions, BuildOptions::enableGlobalVariableSymbols.str()); - } } void ModuleImp::updateBuildLog(NEO::Device *neoDevice) { diff --git a/level_zero/core/source/module/module_imp.h b/level_zero/core/source/module/module_imp.h index b71628b4c5..312a480fc4 100644 --- a/level_zero/core/source/module/module_imp.h +++ b/level_zero/core/source/module/module_imp.h @@ -31,7 +31,6 @@ extern NEO::ConstStringRef greaterThan4GbRequired; extern NEO::ConstStringRef hasBufferOffsetArg; extern NEO::ConstStringRef debugKernelEnable; extern NEO::ConstStringRef enableLibraryCompile; -extern NEO::ConstStringRef enableGlobalVariableSymbols; } // namespace BuildOptions struct ModuleTranslationUnit { @@ -161,7 +160,6 @@ struct ModuleImp : public Module { bool isFullyLinked = false; bool allocatePrivateMemoryPerDispatch = true; bool libraryExportEnabled = false; - bool globalExportEnabled = false; ModuleType type; NEO::Linker::UnresolvedExternals unresolvedExternalsInfo{}; std::set importedSymbolAllocations{}; diff --git a/level_zero/core/test/unit_tests/sources/module/test_module.cpp b/level_zero/core/test/unit_tests/sources/module/test_module.cpp index d34e524773..913089846a 100644 --- a/level_zero/core/test/unit_tests/sources/module/test_module.cpp +++ b/level_zero/core/test/unit_tests/sources/module/test_module.cpp @@ -2477,62 +2477,6 @@ TEST_F(ModuleTest, givenBuildOptionsWithEnableLibraryCompileWhenEnableProgramSym EXPECT_TRUE(NEO::CompilerOptions::contains(buildOptions, BuildOptions::enableLibraryCompile)); } -TEST_F(ModuleTest, givenBuildOptionsWhenEnableGlobalSymbolGenerationIsEnabledThenEnableGlobalVariableSymbolsIsSet) { - DebugManagerStateRestore restorer; - DebugManager.flags.EnableGlobalSymbolGeneration.set(1); - auto module = std::make_unique(device, nullptr, ModuleType::User); - ASSERT_NE(nullptr, module); - - std::string buildOptions; - std::string internalBuildOptions; - - module->createBuildOptions("", buildOptions, internalBuildOptions); - - EXPECT_TRUE(NEO::CompilerOptions::contains(buildOptions, BuildOptions::enableGlobalVariableSymbols)); -} - -TEST_F(ModuleTest, givenBuildOptionsWhenEnableGlobalSymbolGenerationIsDisabledThenEnableGlobalVariableSymbolsIsNotSet) { - DebugManagerStateRestore restorer; - DebugManager.flags.EnableGlobalSymbolGeneration.set(0); - auto module = std::make_unique(device, nullptr, ModuleType::User); - ASSERT_NE(nullptr, module); - - std::string buildOptions; - std::string internalBuildOptions; - - module->createBuildOptions("", buildOptions, internalBuildOptions); - - EXPECT_FALSE(NEO::CompilerOptions::contains(buildOptions, BuildOptions::enableGlobalVariableSymbols)); -} - -TEST_F(ModuleTest, givenBuildOptionsWithEnableGlobalVariableSymbolsWhenEnableGlobalSymbolGenerationIsDisabledThenEnableGlobalVariableSymbolsIsSet) { - DebugManagerStateRestore restorer; - DebugManager.flags.EnableGlobalSymbolGeneration.set(0); - auto module = std::make_unique(device, nullptr, ModuleType::User); - ASSERT_NE(nullptr, module); - - std::string buildOptions; - std::string internalBuildOptions; - - module->createBuildOptions(BuildOptions::enableGlobalVariableSymbols.str().c_str(), buildOptions, internalBuildOptions); - - EXPECT_TRUE(NEO::CompilerOptions::contains(buildOptions, BuildOptions::enableGlobalVariableSymbols)); -} - -TEST_F(ModuleTest, givenBuildOptionsWithEnableGlobalVariableSymbolsWhenEnableGlobalSymbolGenerationIsEnabledThenEnableGlobalVariableSymbolsIsSet) { - DebugManagerStateRestore restorer; - DebugManager.flags.EnableGlobalSymbolGeneration.set(1); - auto module = std::make_unique(device, nullptr, ModuleType::User); - ASSERT_NE(nullptr, module); - - std::string buildOptions; - std::string internalBuildOptions; - - module->createBuildOptions(BuildOptions::enableGlobalVariableSymbols.str().c_str(), buildOptions, internalBuildOptions); - - EXPECT_TRUE(NEO::CompilerOptions::contains(buildOptions, BuildOptions::enableGlobalVariableSymbols)); -} - TEST_F(ModuleTest, givenInternalOptionsWhenBindlessEnabledThenBindlesOptionsPassed) { DebugManagerStateRestore restorer; DebugManager.flags.UseBindlessMode.set(1); diff --git a/shared/source/debug_settings/debug_variables_base.inl b/shared/source/debug_settings/debug_variables_base.inl index 3975217254..f63dca9bec 100644 --- a/shared/source/debug_settings/debug_variables_base.inl +++ b/shared/source/debug_settings/debug_variables_base.inl @@ -335,7 +335,6 @@ DECLARE_DEBUG_VARIABLE(bool, EngineInstancedSubDevices, false, "Create subdevice DECLARE_DEBUG_VARIABLE(bool, AllowSingleTileEngineInstancedSubDevices, false, "Create subdevices assigned to specific engine on single tile config") DECLARE_DEBUG_VARIABLE(bool, EnablePrivateBO, false, "Enable PRELIM_I915_GEM_CREATE_EXT_VM_PRIVATE extension creating VM_PRIVATE BOs") DECLARE_DEBUG_VARIABLE(bool, EnableProgramSymbolTableGeneration, true, "Enforce IGC to always generate the Program Symbol Table for Exported Functions for all Modules used by Level Zero.") -DECLARE_DEBUG_VARIABLE(bool, EnableGlobalSymbolGeneration, true, "Enforce IGC to always generate the Symbol Table Entry for Global Variables for all Modules used by Level Zero") DECLARE_DEBUG_VARIABLE(int32_t, ReturnSubDevicesAsApiDevices, -1, "Expose each subdevice as a separate device during clGetDeviceIDs or zeDeviceGet API call") DECLARE_DEBUG_VARIABLE(int32_t, ForceRunAloneContext, -1, "Control creation of run-alone HW context, -1:default, 0:disable, 1:enable") DECLARE_DEBUG_VARIABLE(int32_t, AddClGlSharing, -1, "Add cl-gl extension") diff --git a/shared/test/common/test_files/igdrcl.config b/shared/test/common/test_files/igdrcl.config index 9414640c57..d8ede563a1 100644 --- a/shared/test/common/test_files/igdrcl.config +++ b/shared/test/common/test_files/igdrcl.config @@ -351,7 +351,6 @@ OverrideDrmRegion = -1 AllowSingleTileEngineInstancedSubDevices = 0 EnableProgramSymbolTableGeneration = 1 BinaryCacheTrace = false -EnableGlobalSymbolGeneration = 1 OverrideL1CacheControlInSurfaceState = -1 OverrideL1CacheControlInSurfaceStateForScratchSpace = -1 OverridePreferredSlmAllocationSizePerDss = -1