diff --git a/src/coreclr/jit/importer.cpp b/src/coreclr/jit/importer.cpp index 5dc6234a55ba1..3f509e79245dc 100644 --- a/src/coreclr/jit/importer.cpp +++ b/src/coreclr/jit/importer.cpp @@ -21325,6 +21325,12 @@ void Compiler::impDevirtualizeCall(GenTreeCall* call, return; } + // Bail if optimizations are disabled. + if (opts.OptimizationDisabled()) + { + return; + } + #if defined(DEBUG) // Bail if devirt is disabled. if (JitConfig.JitEnableDevirtualization() == 0)