diff --git a/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunSingleAssemblyCompilationModuleGroup.cs b/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunSingleAssemblyCompilationModuleGroup.cs index 71450f6d12487e..add2cbc8e43838 100644 --- a/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunSingleAssemblyCompilationModuleGroup.cs +++ b/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunSingleAssemblyCompilationModuleGroup.cs @@ -29,7 +29,9 @@ protected sealed override bool ContainsMethodBodyCore(MethodDesc method, bool un if (_profileGuidedCompileRestriction != null) { - if (!_profileGuidedCompileRestriction.IsMethodInInputProfileData(method)) + if (!_profileGuidedCompileRestriction.IsMethodInInputProfileData(method) && + (((ReadyToRunCompilerContext)method.Context).TargetAllowsRuntimeCodeGeneration || + !HardwareIntrinsicHelpers.IsHardwareIntrinsic(method))) return false; }