From: Jeremy Koritzinsky Date: Fri, 1 Mar 2019 16:48:49 +0000 (-0800) Subject: Turn on IBC and enforce PGO in official and release builds. (#22843) X-Git-Tag: accepted/tizen/unified/20190813.215958~61^2~87 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d778ad50511f5511ef799afa7fdef86ab5756e95;p=platform%2Fupstream%2Fcoreclr.git Turn on IBC and enforce PGO in official and release builds. (#22843) * Enable pgocheck to run on python 3. * Enable IBC optimizations in official builds and enforce PGO in release builds on platforms where pgocheck.py works. * Only enable IBC on Windows x64/x86. --- diff --git a/eng/build-job.yml b/eng/build-job.yml index d14ffc1..8f4fa5d 100644 --- a/eng/build-job.yml +++ b/eng/build-job.yml @@ -72,9 +72,21 @@ jobs: value: $(buildConfigUpper) - name: officialBuildIdArg value: '' + - name: ibcOptimizeArg + value: '' - ${{ if and(eq(variables['System.TeamProject'], 'internal'), ne(variables['Build.Reason'], 'PullRequest')) }}: - name: officialBuildIdArg value: '-officialbuildid=$(Build.BuildNumber)' + # IBCMerge is currently Windows-only and x86/x64-only + - ${{ if and(eq(parameters.osGroup, 'Windows_NT'), or(eq(parameters.archType, 'x64'), eq(parameters.archType, 'x86'))) }}: + - name: ibcOptimizeArg + value: '-ibcoptimize' + - name: enforcePgoArg + value: '' + # The EnforcePGO script is only supported on Windows and is not supported on arm or arm64. + - ${{ if and(eq(parameters.buildConfig, 'Release'), and(eq(parameters.osGroup, 'Windows_NT'), not(or(eq(parameters.archType, 'arm64'), eq(parameters.archType, 'arm'))))) }}: + - name: enforcePgoArg + value: '-enforcepgo' steps: @@ -100,8 +112,7 @@ jobs: # Once we are using Arcade, use DotNetCoreSdkDir instead, as we do below. DotNetBootstrapCliTarPath: /dotnet-sdk-freebsd-x64.tar - ${{ if eq(parameters.osGroup, 'Windows_NT') }}: - # TODO: IBCOptimize? EnforcePGO? file logging parameters? - - script: set __TestIntermediateDir=int&&build.cmd $(buildConfig) $(archType) -skiptests -skipbuildpackages $(officialBuildIdArg) + - script: set __TestIntermediateDir=int&&build.cmd $(buildConfig) $(archType) -skiptests -skipbuildpackages $(officialBuildIdArg) $(ibcOptimizeArg) $(enforcePgoArg) displayName: Build product # Sign on Windows diff --git a/src/scripts/pgocheck.py b/src/scripts/pgocheck.py index d408e6e..39cb0f2 100644 --- a/src/scripts/pgocheck.py +++ b/src/scripts/pgocheck.py @@ -26,7 +26,9 @@ pgo_pattern_str = r'coffgrp(?:\s+[0-9A-F]+){4}\s+\((\S*)\)' pgo_pattern = re.compile(pgo_pattern_str) def was_compiled_with_pgo(filename): - headers = subprocess.check_output(["link", "/dump", "/headers", filename]) + # When running on Python 3, check_output returns a bytes object, which we need to + # decode to a string object. + headers = subprocess.check_output(["link", "/dump", "/headers", filename]).decode('utf-8') match = pgo_pattern.search(headers)