From 3c4e2dc134c979976ea2e771a13751bc835b6310 Mon Sep 17 00:00:00 2001 From: Bruce Forstall Date: Wed, 17 Oct 2018 16:28:29 -0700 Subject: [PATCH] Print Tier-0 or Tier-1 to JIT dump output (dotnet/coreclr#20453) * Print Tier-0 or Tier-1 to JIT dump output Make it very obvious we've been asked to generate Tier-0 code. * Print Tier-0 or Tier-1 in assembly output, as appropriate Commit migrated from https://github.com/dotnet/coreclr/commit/ff467045bc24fcf890ca6f1b58c647cc44b013bd --- src/coreclr/src/jit/codegencommon.cpp | 9 +++++++++ src/coreclr/src/jit/compiler.cpp | 12 ++++++++++++ 2 files changed, 21 insertions(+) diff --git a/src/coreclr/src/jit/codegencommon.cpp b/src/coreclr/src/jit/codegencommon.cpp index 2a9b5e3..4d908da 100644 --- a/src/coreclr/src/jit/codegencommon.cpp +++ b/src/coreclr/src/jit/codegencommon.cpp @@ -2276,6 +2276,15 @@ void CodeGen::genGenerateCode(void** codePtr, ULONG* nativeSizeOfCode) printf("\n"); + if (compiler->opts.jitFlags->IsSet(JitFlags::JIT_FLAG_TIER0)) + { + printf("; Tier-0 compilation\n"); + } + if (compiler->opts.jitFlags->IsSet(JitFlags::JIT_FLAG_TIER1)) + { + printf("; Tier-1 compilation\n"); + } + if ((compiler->opts.compFlags & CLFLG_MAXOPT) == CLFLG_MAXOPT) { printf("; optimized code\n"); diff --git a/src/coreclr/src/jit/compiler.cpp b/src/coreclr/src/jit/compiler.cpp index c9b7bb9..e11d11f 100644 --- a/src/coreclr/src/jit/compiler.cpp +++ b/src/coreclr/src/jit/compiler.cpp @@ -3661,6 +3661,18 @@ void Compiler::compInitOptions(JitFlags* jitFlags) if (verbose) { + // If we are compiling for a specific tier, make that very obvious in the output. + // Note that we don't expect multiple TIER flags to be set at one time, but there + // is nothing preventing that. + if (jitFlags->IsSet(JitFlags::JIT_FLAG_TIER0)) + { + printf("OPTIONS: Tier-0 compilation (set COMPlus_TieredCompilation=0 to disable)\n"); + } + if (jitFlags->IsSet(JitFlags::JIT_FLAG_TIER1)) + { + printf("OPTIONS: Tier-1 compilation\n"); + } + printf("OPTIONS: compCodeOpt = %s\n", (opts.compCodeOpt == BLENDED_CODE) ? "BLENDED_CODE" -- 2.7.4