From 4aefdd70ff0df62793f823713c9f712ca2f11b61 Mon Sep 17 00:00:00 2001 From: Andy Ayers Date: Thu, 12 Jan 2017 16:59:00 -0800 Subject: [PATCH] JIT: remove match accounting from inliner state machine The inliner's code-size estimating state machine keeps count of matches, but the count was only used in an assert that checked that the count did not overflow. The assert fired when jit stress drove the inliner to evaluate a huge method as a potential inline candidate and the count reached the overflow value. This change removes the counting and the related assert. Closes dotnet/coreclr#8932. Commit migrated from https://github.com/dotnet/coreclr/commit/7a4db6754a20aa6cb0a11850d08c844b9653af94 --- src/coreclr/src/jit/sm.cpp | 5 ----- src/coreclr/src/jit/sm.h | 3 --- 2 files changed, 8 deletions(-) diff --git a/src/coreclr/src/jit/sm.cpp b/src/coreclr/src/jit/sm.cpp index 859b238..b016899 100644 --- a/src/coreclr/src/jit/sm.cpp +++ b/src/coreclr/src/jit/sm.cpp @@ -51,11 +51,6 @@ void CodeSeqSM::Start(Compiler* comp) void CodeSeqSM::Reset() { curState = SM_STATE_ID_START; - -#ifdef DEBUG - // Reset the state occurence counts - memset(StateMatchedCounts, 0, sizeof(StateMatchedCounts)); -#endif } void CodeSeqSM::End() diff --git a/src/coreclr/src/jit/sm.h b/src/coreclr/src/jit/sm.h index 33d6509..8c90e0b 100644 --- a/src/coreclr/src/jit/sm.h +++ b/src/coreclr/src/jit/sm.h @@ -42,9 +42,7 @@ public: inline void TermStateMatch(SM_STATE_ID stateID DEBUGARG(bool verbose)) { assert(States[stateID].term); - assert(StateMatchedCounts[stateID] < _UI16_MAX); #ifdef DEBUG - ++StateMatchedCounts[stateID]; #ifndef SMGEN_COMPILE if (verbose) { @@ -65,7 +63,6 @@ public: } #ifdef DEBUG - WORD StateMatchedCounts[NUM_SM_STATES]; const char* StateDesc(SM_STATE_ID stateID); #endif -- 2.7.4