Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dotnet/runtime.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src/tasks
diff options
context:
space:
mode:
authorMitchell Hwang <16830051+mdh1418@users.noreply.github.com>2022-06-07 00:20:48 +0300
committerGitHub <noreply@github.com>2022-06-07 00:20:48 +0300
commit2b21dcd43a6ce1f57c7ba3fd684d7b9792d4976e (patch)
treec2f4113e808a50b072553d8d71e5472b5642ab53 /src/tasks
parentf1cd5168b3bdc8a3b8a54dfe981e3754f4b7a1b1 (diff)
[mono] Extend mono AOT compiler to ingest .mibc profiles (#70194)
* [mono] Add non_executable field to MonoImage to properly load MethodRef in .mibc files * [mono][aot] Extend mono-aot-compiler to handle .mibc profile * [tasks] Extend MonoAOTCompiler task to handle .mibc profiles * Address feedback * Add method descriptions * Address more feedback
Diffstat (limited to 'src/tasks')
-rw-r--r--src/tasks/AotCompilerTask/MonoAOTCompiler.cs26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/tasks/AotCompilerTask/MonoAOTCompiler.cs b/src/tasks/AotCompilerTask/MonoAOTCompiler.cs
index 66cf3ec06e8..fcc24b6111b 100644
--- a/src/tasks/AotCompilerTask/MonoAOTCompiler.cs
+++ b/src/tasks/AotCompilerTask/MonoAOTCompiler.cs
@@ -117,6 +117,11 @@ public class MonoAOTCompiler : Microsoft.Build.Utilities.Task
public string[]? AotProfilePath { get; set; }
/// <summary>
+ /// Mibc file to use for profile-guided optimization, *only* the methods described in the file will be AOT compiled.
+ /// </summary>
+ public string[]? MibcProfilePath { get; set; }
+
+ /// <summary>
/// List of profilers to use.
/// </summary>
public string[]? Profilers { get; set; }
@@ -278,6 +283,18 @@ public class MonoAOTCompiler : Microsoft.Build.Utilities.Task
}
}
+ if (MibcProfilePath != null)
+ {
+ foreach (var path in MibcProfilePath)
+ {
+ if (!File.Exists(path))
+ {
+ Log.LogError($"MibcProfilePath '{path}' doesn't exist.");
+ return false;
+ }
+ }
+ }
+
if (UseLLVM)
{
if (string.IsNullOrEmpty(LLVMPath))
@@ -739,6 +756,15 @@ public class MonoAOTCompiler : Microsoft.Build.Utilities.Task
}
}
+ if (MibcProfilePath?.Length > 0)
+ {
+ aotArgs.Add("profile-only");
+ foreach (var path in MibcProfilePath)
+ {
+ aotArgs.Add($"mibc-profile={path}");
+ }
+ }
+
if (!string.IsNullOrEmpty(AotArguments))
{
aotArgs.Add(AotArguments);