JIT: remove match accounting from inliner state machine
authorAndy Ayers <andya@microsoft.com>
Fri, 13 Jan 2017 00:59:00 +0000 (16:59 -0800)
committerAndy Ayers <andya@microsoft.com>
Fri, 13 Jan 2017 01:31:51 +0000 (17:31 -0800)
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
src/coreclr/src/jit/sm.h

index 859b238..b016899 100644 (file)
@@ -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()
index 33d6509..8c90e0b 100644 (file)
@@ -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