From ae7a3f6b47fb12537081f452a7a020964c8c0608 Mon Sep 17 00:00:00 2001 From: Andy Ayers Date: Tue, 16 Jan 2024 17:59:06 -0800 Subject: [PATCH 1/2] JIT: remove size contribution to perf score Keep the perf score a pure performance metric. Size is emitted as a separate metric, so clients interested in a metric that is some combination of size and speed can do their own computations based on these two values. Resolves #96878. --- src/coreclr/jit/codegencommon.cpp | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/coreclr/jit/codegencommon.cpp b/src/coreclr/jit/codegencommon.cpp index 09a28cc373bf49..98b4b88bd7ca1f 100644 --- a/src/coreclr/jit/codegencommon.cpp +++ b/src/coreclr/jit/codegencommon.cpp @@ -2002,14 +2002,6 @@ void CodeGen::genEmitMachineCode() compiler->compCodeGenDone = true; #endif -#if defined(DEBUG) || defined(LATE_DISASM) - // Add code size information into the Perf Score - // All compPerfScore calculations must be performed using doubles - compiler->info.compPerfScore += ((double)compiler->info.compTotalHotCodeSize * (double)PERFSCORE_CODESIZE_COST_HOT); - compiler->info.compPerfScore += - ((double)compiler->info.compTotalColdCodeSize * (double)PERFSCORE_CODESIZE_COST_COLD); -#endif // DEBUG || LATE_DISASM - if (compiler->opts.disAsm && compiler->opts.disTesting) { printf("; END METHOD %s\n", compiler->eeGetMethodFullName(compiler->info.compMethodHnd)); From f8e5c884be433f09d2b1724248ce4c1d6ecb6d95 Mon Sep 17 00:00:00 2001 From: Andy Ayers Date: Wed, 17 Jan 2024 17:49:17 -0800 Subject: [PATCH 2/2] review feedback --- src/coreclr/jit/emit.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/coreclr/jit/emit.h b/src/coreclr/jit/emit.h index f896e5258741b4..d57e86d1058e68 100644 --- a/src/coreclr/jit/emit.h +++ b/src/coreclr/jit/emit.h @@ -1863,11 +1863,6 @@ class emitter #define PERFSCORE_MEMORY_WRITE 2 #define PERFSCORE_MEMORY_READ_WRITE 3 -#define PERFSCORE_CODESIZE_COST_HOT 0.10f -#define PERFSCORE_CODESIZE_COST_COLD 0.01f - -#define PERFSCORE_CALLEE_SPILL_COST 0.75f - struct insExecutionCharacteristics { float insThroughput;