Add LLVM-AOT support to the sample app (#90152)
authorMilos Kotlar <kotlarmilos@gmail.com>
Wed, 9 Aug 2023 13:27:45 +0000 (15:27 +0200)
committerGitHub <noreply@github.com>
Wed, 9 Aug 2023 13:27:45 +0000 (15:27 +0200)
src/mono/sample/HelloWorld/HelloWorld.csproj
src/mono/sample/HelloWorld/Makefile

index ef6aa16..e72a411 100644 (file)
@@ -18,7 +18,6 @@
 
     <ItemGroup>
       <AotInputAssemblies Include="$(PublishDir)\*.dll" />
-      <ReferenceAssembliesForPGO Include="$(PublishDir)\*.dll" />
     </ItemGroup>
 
     <MonoAOTCompiler
       CompiledMethodsOutputDirectory="$(CompiledMethodsOutputDirectory)"
       IntermediateOutputPath="$(IntermediateOutputPath)"
       UseAotDataFile="$(UseAotDataFile)"
-      CacheFilePath="$(IntermediateOutputPath)aot_compiler_cache.json"
-      NetTracePath="$(NetTracePath)"
-      PgoBinaryPath="$(PgoBinaryPath)"
-      ReferenceAssembliesForPGO="@(ReferenceAssembliesForPGO)"
-      MibcProfilePath="$(MibcProfilePath)">
+      MibcProfilePath="$(MibcProfilePath)"
+      UseLLVM="$(MonoEnableLLVM)"
+      LLVMPath="$(MonoAotCrossDir)">
       <Output TaskParameter="CompiledAssemblies" ItemName="BundleAssemblies" />
     </MonoAOTCompiler>
   </Target>
index 8441e56..cfb6f07 100644 (file)
@@ -6,11 +6,10 @@ MONO_CONFIG?=Debug
 MONO_ARCH?=$(shell . $(TOP)eng/native/init-os-and-arch.sh && echo $${arch})
 TARGET_OS?=$(shell . $(TOP)eng/native/init-os-and-arch.sh && echo $${os})
 AOT?=false
+USE_LLVM?=false
 StripILCode?=false
 CompiledMethodsOutputDirectory?= #<path-to-a-writable-directory>
 
-#NET_TRACE_PATH=<path-to-trace-of-sample>
-#PGO_BINARY_PATH=<path-to-dotnet-pgo-executable>
 #MIBC_PROFILE_PATH=<path-to-mibc-for-sample>
 
 MONO_ENV_OPTIONS ?=
@@ -20,11 +19,11 @@ publish:
        -c $(MONO_CONFIG) \
        -r $(TARGET_OS)-$(MONO_ARCH) \
        /p:RunAOTCompilation=$(AOT) \
+       /p:MonoEnableLLVM=$(USE_LLVM) \
        /p:StripILCode=$(StripILCode) \
        /p:CompiledMethodsOutputDirectory=$(CompiledMethodsOutputDirectory) \
-       '/p:NetTracePath="$(NET_TRACE_PATH)"' \
-       '/p:PgoBinaryPath="$(PGO_BINARY_PATH)"' \
-       '/p:MibcProfilePath="$(MIBC_PROFILE_PATH)"'
+       '/p:MibcProfilePath="$(MIBC_PROFILE_PATH)"' \
+       /bl
 
 run: publish
        DOTNET_DebugWriteToStdErr=1 \