summaryrefslogtreecommitdiff
path: root/src/vm/methodtablebuilder.cpp
diff options
context:
space:
mode:
authorMichal Strehovský <MichalStrehovsky@users.noreply.github.com>2019-06-14 00:24:59 +0200
committerSergiy Kuryata <sergeyk@microsoft.com>2019-06-13 15:24:59 -0700
commite73c8e6c4a98b7ef6335afa31052bed7313fd816 (patch)
treedb14e93657a8ef482d51f8ad10f2fed720703a0e /src/vm/methodtablebuilder.cpp
parent6bcbd9348c277287539b2f97befc7b5d25b142e8 (diff)
downloadcoreclr-e73c8e6c4a98b7ef6335afa31052bed7313fd816.tar.gz
coreclr-e73c8e6c4a98b7ef6335afa31052bed7313fd816.tar.bz2
coreclr-e73c8e6c4a98b7ef6335afa31052bed7313fd816.zip
Allow pregenerating most HW intrinsics in CoreLib (#24917)
* Allow pregenerating all HW intrinsics in CoreLib This is a follow up to #24689 that lets us pregenerate all hardware intrinsics in CoreLib. We ensures the potentially unsupported code will never be reachable at runtime on CPUs that don't support it by not reporting the `IsSupported` property as intrinsic in crossgen. This ensures the support checks are always JITted. JITting the support checks is very cheap. There is cost in the form of an extra call and failure to do constant propagation of the return value, but the cost is negligible in practice and gets eliminated once the tiered JIT tiers the method up. We only do this in CoreLib because user code could technically not guard intrinsic use in `IsSupported` checks and pregenerating the code could lead to illegal instruction traps at runtime (instead of `PlatformNotSupportedException` throws) - it's a bad user experience.
Diffstat (limited to 'src/vm/methodtablebuilder.cpp')
-rw-r--r--src/vm/methodtablebuilder.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/vm/methodtablebuilder.cpp b/src/vm/methodtablebuilder.cpp
index 2a59be4f33..bec874ef45 100644
--- a/src/vm/methodtablebuilder.cpp
+++ b/src/vm/methodtablebuilder.cpp
@@ -1521,14 +1521,11 @@ MethodTableBuilder::BuildMethodTableThrowing(
#if defined(CROSSGEN_COMPILE)
#if defined(_TARGET_X86_) || defined(_TARGET_AMD64_)
if ((!IsNgenPDBCompilationProcess()
- && GetAppDomain()->ToCompilationDomain()->GetTargetModule() != g_pObjectClass->GetModule())
- || (strcmp(className, "Sse") != 0 && strcmp(className, "Sse2") != 0))
+ && GetAppDomain()->ToCompilationDomain()->GetTargetModule() != g_pObjectClass->GetModule()))
#endif // defined(_TARGET_X86_) || defined(_TARGET_AMD64_)
{
// Disable AOT compiling for managed implementation of hardware intrinsics.
// We specially treat them here to ensure correct ISA features are set during compilation
- // The only exception to this rule are SSE and SSE2 intrinsics in CoreLib - we can
- // safely expand those because we require them to be always available.
COMPlusThrow(kTypeLoadException, IDS_EE_HWINTRINSIC_NGEN_DISALLOWED);
}
#endif // defined(CROSSGEN_COMPILE)