Skip to content

Commit

Permalink
JIT: adjust assert in optUnmarkCSE (#58600)
Browse files Browse the repository at this point in the history
Modify the assert we use to check that someone forgot to set `optCSEweight`,
so that it works if we have blocks with max weight.

Fixes #58371.
  • Loading branch information
AndyAyersMS authored Sep 3, 2021
1 parent 462ab6e commit a561308
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/coreclr/jit/optcse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ bool Compiler::optUnmarkCSE(GenTree* tree)
}

// make sure it's been initialized
noway_assert(optCSEweight <= BB_MAX_WEIGHT);
noway_assert(optCSEweight >= 0);

// Is this a CSE use?
if (IS_CSE_USE(tree->gtCSEnum))
Expand Down Expand Up @@ -3452,6 +3452,7 @@ void Compiler::optOptimizeValnumCSEs()
#endif

optValnumCSE_phase = true;
optCSEweight = -1.0f;

optValnumCSE_Init();

Expand Down

0 comments on commit a561308

Please sign in to comment.