From 8672eddc4f6399c8d376f1440a3982d7e3e910d1 Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Wed, 4 Dec 2024 10:38:06 -0800 Subject: [PATCH] Allow AltJit for matched VM to also use otherwise unsupported ISAs (#110320) --- src/coreclr/jit/compiler.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/coreclr/jit/compiler.cpp b/src/coreclr/jit/compiler.cpp index 2ed11f5ff9e2c..397c2bfed103d 100644 --- a/src/coreclr/jit/compiler.cpp +++ b/src/coreclr/jit/compiler.cpp @@ -6042,8 +6042,13 @@ int Compiler::compCompile(CORINFO_MODULE_HANDLE classPtr, // Note that it might be better to do this immediately when setting the JIT flags in CILJit::compileMethod() // (when JitFlags::SetFromFlags() is called), but this is close enough. (To move this logic to // CILJit::compileMethod() would require moving the info.compMatchedVM computation there as well.) + // + // We additionally want to do this for AltJit so that we can validate ISAs that the underlying CPU may + // not support directly. Doing this check later, after opts.altJit has been initialized might be better + // but it requires moving the whole set of logic down into compCompileHelper after compInitOptions has + // run and we're going to end up exiting early if JIT_FLAG_ALT_JIT and opts.altJit don't match anyways - if (!info.compMatchedVM) + if (!info.compMatchedVM || compileFlags->IsSet(JitFlags::JIT_FLAG_ALT_JIT)) { CORINFO_InstructionSetFlags instructionSetFlags;