Use newest PGO data for Linux and windows-x86 (#51656)
authorAndy Gocke <angocke@microsoft.com>
Sun, 25 Apr 2021 01:18:20 +0000 (18:18 -0700)
committerGitHub <noreply@github.com>
Sun, 25 Apr 2021 01:18:20 +0000 (18:18 -0700)
This data was previously held back because we weren't producing
builds with Linux or windows-x86 but now we are. The Linux builds
now produce only a single profdata file, coreclr.profdata, which
should contain all the profile information for all the libraries in the
runtime.

eng/Version.Details.xml
eng/Versions.props
src/coreclr/.nuget/optdata/optdata.csproj
src/coreclr/pgosupport.cmake

index 26428d2..2bacc8f 100644 (file)
@@ -86,7 +86,7 @@
       <Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-optimization</Uri>
       <Sha>f69d7fc09c4fdb9e9427741b9a176e867dab577f</Sha>
     </Dependency>
-    <Dependency Name="optimization.PGO.CoreCLR" Version="99.99.99-master-20200806.6">
+    <Dependency Name="optimization.PGO.CoreCLR" Version="99.99.99-master-20210420.2">
       <Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-optimization</Uri>
       <Sha>f69d7fc09c4fdb9e9427741b9a176e867dab577f</Sha>
     </Dependency>
index a6086ee..08a5e19 100644 (file)
     <optimizationlinuxx64IBCCoreFxVersion>99.99.99-master-20200806.6</optimizationlinuxx64IBCCoreFxVersion>
     <optimizationwindows_ntx64IBCCoreCLRVersion>99.99.99-master-20200806.6</optimizationwindows_ntx64IBCCoreCLRVersion>
     <optimizationlinuxx64IBCCoreCLRVersion>99.99.99-master-20200806.6</optimizationlinuxx64IBCCoreCLRVersion>
-    <optimizationPGOCoreCLRVersion>99.99.99-master-20210415.12</optimizationPGOCoreCLRVersion>
+    <optimizationPGOCoreCLRVersion>99.99.99-master-20210420.2</optimizationPGOCoreCLRVersion>
     <!-- Not auto-updated. -->
     <MicrosoftDiaSymReaderNativeVersion>16.9.0-beta1.21055.5</MicrosoftDiaSymReaderNativeVersion>
     <SystemCommandLineVersion>2.0.0-beta1.20253.1</SystemCommandLineVersion>
index 3bb1e6d..716f99f 100644 (file)
@@ -8,8 +8,6 @@
     <OptimizationDataSupported Condition="'$(TargetOS)' == 'Linux' And '$(TargetArchitecture)' == 'x64'">True</OptimizationDataSupported>
 
     <!-- At the moment, we are only generating data for Windows X64 in the most recent optimization data publishing platform. Use the old data for now -->
-    <oldOptimizationPGOCoreCLRVersion>99.99.99-master-20200806.6</oldOptimizationPGOCoreCLRVersion>
-    <optimizationPGOCoreCLRVersion Condition="'$(TargetOS)' != 'windows' or '$(TargetArchitecture)' != 'x64'">$(oldOptimizationPGOCoreCLRVersion)</optimizationPGOCoreCLRVersion>
     <RuntimeIdentifiers>win7-x64;win7-x86;linux-x64</RuntimeIdentifiers>
     <ExcludeFromSourceBuild>true</ExcludeFromSourceBuild>
     <_TargetOSArchLowercase>$(TargetOS.ToLower())-$(TargetArchitecture.ToLower())</_TargetOSArchLowercase>
index 1e2be5d..c0791c4 100644 (file)
@@ -30,7 +30,7 @@ function(add_pgo TargetName)
         if(CLR_CMAKE_HOST_WIN32)
             set(ProfileFileName "${TargetName}.pgd")
         else(CLR_CMAKE_HOST_WIN32)
-            set(ProfileFileName "${TargetName}.profdata")
+            set(ProfileFileName "coreclr.profdata")
         endif(CLR_CMAKE_HOST_WIN32)
 
         file(TO_NATIVE_PATH
@@ -41,6 +41,10 @@ function(add_pgo TargetName)
         # If we don't have profile data availble, gracefully fall back to a non-PGO opt build
         if(NOT EXISTS ${ProfilePath})
             message("PGO data file NOT found: ${ProfilePath}")
+        elseif(CMAKE_GENERATOR MATCHES "Visual Studio")
+            # MSVC is sensitive to exactly the options passed during PGO optimization and Ninja and
+            # MSBuild differ slightly (but not meaningfully for runtime behavior)
+            message("Cannot use PGO optimization built with Ninja from MSBuild. Re-run build with Ninja to apply PGO information")
         else(NOT EXISTS ${ProfilePath})
             if(CLR_CMAKE_HOST_WIN32)
                 set_property(TARGET ${TargetName} APPEND_STRING PROPERTY LINK_FLAGS_RELEASE        " /LTCG /USEPROFILE:PGD=\"${ProfilePath}\"")