Skip to content

Commit

Permalink
perfScoreUnhandledInstruction will now assert in a DEBUG or CHECKED b…
Browse files Browse the repository at this point in the history
…uild when it encounters an unhanded instruction
  • Loading branch information
briansull committed Feb 27, 2020
1 parent 7a68354 commit 54c1e90
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/coreclr/src/jit/emit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1146,18 +1146,17 @@ float emitter::insEvaluateExecutionCost(instrDesc* id)
// if we return these are updated with default values
//
// Notes:
// When validating that the PerfScore handles every instruction.
// the #if 0 block is changed into a #ifdef DEBUG
// We will print the instruction and instruction group
// We print the instruction and instruction group
// and instead of returning we will assert
//
// Otherwise we will return default latencies of 1 cycle.
// This method asserts with a debug/checked build
// and returns default latencies of 1 cycle otherwise.
//
void emitter::perfScoreUnhandledInstruction(instrDesc* id, insExecutionCharacteristics* pResult)
{
// Change this to #ifdef DEBUG to assert on any unhandled instructions
#if 0
printf("PerfScore: unhandled instruction: %s, format %s", codeGen->genInsName(id->idIns()), emitIfName(id->idInsFmt()));
#ifdef DEBUG
printf("PerfScore: unhandled instruction: %s, format %s", codeGen->genInsName(id->idIns()),
emitIfName(id->idInsFmt()));
assert(!"PerfScore: unhandled instruction");
#endif
pResult->insThroughput = PERFSCORE_THROUGHPUT_1C;
Expand Down

0 comments on commit 54c1e90

Please sign in to comment.