diff options
author | Daniel Podder <dpodder@gmail.com> | 2016-10-04 01:39:49 -0700 |
---|---|---|
committer | Jan Vorlicek <janvorli@microsoft.com> | 2016-10-04 10:39:49 +0200 |
commit | 114b58869def96c720d0c2fd9b77ceccdc924b96 (patch) | |
tree | 91445052c408051a7582b8a891b2166162e38bc6 /build.cmd | |
parent | 4d6710d76ba222b1bf9aaef9b475a3229f827824 (diff) | |
download | coreclr-114b58869def96c720d0c2fd9b77ceccdc924b96.tar.gz coreclr-114b58869def96c720d0c2fd9b77ceccdc924b96.tar.bz2 coreclr-114b58869def96c720d0c2fd9b77ceccdc924b96.zip |
Add PGO GENPROFILE support to coreclr and clrjit (#7423)
* Add PGO GENPROFILE support to coreclr and clrjit
Update the cmake build system to enable support for Profile Guided
Optimization (PGO) on Windows, and enable this feature for two target
binaries (coreclr and clrjit).
With this change, toggle between instrumented and profile-optimized
settings for target binaries by passing pgoinstrument argument to the build.cmd
Assume profile-optimized mode by default. Fall back to regular non-PGO
optimized builds if profile data is not available.
Diffstat (limited to 'build.cmd')
-rw-r--r-- | build.cmd | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -52,6 +52,8 @@ set __BuildTypeChecked=0 set __BuildTypeRelease=0 set __BuildJit32="-DBUILD_JIT32=0" +set __PgoInstrument=0 + REM __PassThroughArgs is a set of things that will be passed through to nested calls to build.cmd REM when using "all". set __PassThroughArgs= @@ -103,6 +105,7 @@ if /i "%1" == "skiptests" (set __BuildTests=0&set processedArgs=!proce if /i "%1" == "skipbuildpackages" (set __BuildPackages=0&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) if /i "%1" == "usenmakemakefiles" (set __NMakeMakefiles=1&set __ConfigureOnly=1&set __BuildNative=1&set __BuildNativeCoreLib=0&set __BuildCoreLib=0&set __BuildTests=0&set __BuildPackages=0&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) if /i "%1" == "buildjit32" (set __BuildJit32="-DBUILD_JIT32=1"&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) +if /i "%1" == "pgoinstrument" (set __PgoInstrument=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) if /i "%1" == "toolset_dir" (set __ToolsetDir=%2&set __PassThroughArgs=%__PassThroughArgs% %2&set processedArgs=!processedArgs! %1 %2&shift&shift&goto Arg_Loop) if [!processedArgs!]==[] ( @@ -233,7 +236,8 @@ if %__BuildNative% EQU 1 ( echo %__MsgPrefix%Regenerating the Visual Studio solution pushd "%__IntermediatesDir%" - call "%__SourceDir%\pal\tools\gen-buildsys-win.bat" "%__ProjectDir%" %__VSVersion% %__BuildArch% %__BuildJit32% + set __ExtraCmakeArgs="-DCLR_CMAKE_TARGET_OS=%__BuildOs%" "-DCLR_CMAKE_PACKAGES_DIR=%__PackagesDir%" "-DCLR_CMAKE_PGO_INSTRUMENT=%__PgoInstrument%" + call "%__SourceDir%\pal\tools\gen-buildsys-win.bat" "%__ProjectDir%" %__VSVersion% %__BuildArch% %__BuildJit32% !__ExtraCmakeArgs! @if defined __echo @echo on popd :SkipConfigure @@ -286,7 +290,7 @@ if /i "%__DoCrossArchBuild%"=="1" ( pushd "%__CrossCompIntermediatesDir%" set __CMakeBinDir=%__CrossComponentBinDir% set "__CMakeBinDir=!__CMakeBinDir:\=/!" - set __ExtraCmakeArgs="-DCLR_CROSS_COMPONENTS_BUILD=1" "-DCLR_CMAKE_TARGET_ARCH=%__BuildArch%" + set __ExtraCmakeArgs="-DCLR_CROSS_COMPONENTS_BUILD=1" "-DCLR_CMAKE_TARGET_ARCH=%__BuildArch%" "-DCLR_CMAKE_TARGET_OS=%__BuildOs%" "-DCLR_CMAKE_PACKAGES_DIR=%__PackagesDir%" "-DCLR_CMAKE_PGO_INSTRUMENT=%__PgoInstrument%" call "%__SourceDir%\pal\tools\gen-buildsys-win.bat" "%__ProjectDir%" %__VSVersion% %__CrossArch% !__ExtraCmakeArgs! @if defined __echo @echo on popd @@ -538,6 +542,7 @@ echo for the specified platform ^(FreeBSD, Linux, NetBSD, OS X or Windows, echo respectively^). echo add nativemscorlib to go further and build the native image for designated mscorlib. echo toolset_dir ^<dir^> : set the toolset directory -- Arm64 use only. Required for Arm64 builds. +echo pgoinstrument: generate instrumented code for profile guided optimization enabled binaries. echo configureonly: skip all builds; only run CMake ^(default: CMake and builds are run^) echo skipconfigure: skip CMake ^(default: CMake is run^) echo skipmscorlib: skip building System.Private.CoreLib ^(default: System.Private.CoreLib is built^). |