Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/coreclr/jit/block.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ typedef BitVec EXPSET_TP;
typedef BitVec_ValArg_T EXPSET_VALARG_TP;
typedef BitVec_ValRet_T EXPSET_VALRET_TP;

#define EXPSET_SZ 64
#define EXPSET_SZ 127

typedef BitVec ASSERT_TP;
typedef BitVec_ValArg_T ASSERT_VALARG_TP;
Expand Down
1 change: 1 addition & 0 deletions src/coreclr/jit/jitmetadatalist.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ JITMETADATAMETRIC(HoistedExpressions, int, 0)
JITMETADATAMETRIC(RedundantBranchesEliminated, int, JIT_METADATA_HIGHER_IS_BETTER)
JITMETADATAMETRIC(JumpThreadingsPerformed, int, JIT_METADATA_HIGHER_IS_BETTER)
JITMETADATAMETRIC(CseCount, int, 0)
JITMETADATAMETRIC(CseDeniedCount, int, 0)
JITMETADATAMETRIC(BasicBlocksAtCodegen, int, 0)
JITMETADATAMETRIC(PerfScore, double, JIT_METADATA_LOWER_IS_BETTER)
JITMETADATAMETRIC(BytesAllocated, int64_t, JIT_METADATA_LOWER_IS_BETTER)
Expand Down
20 changes: 19 additions & 1 deletion src/coreclr/jit/optcse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,13 @@ unsigned Compiler::optValnumCSE_Index(GenTree* tree, Statement* stmt)
hashDsc->csdNextInBucket = optCSEhash[hval];
optCSEhash[hval] = hashDsc;
}
#ifdef DEBUG
else
{
JITDUMP("CSE budget exhausted: untracked occurrence [%06u] in " FMT_BB ", key %zx, cost %u, weight %f\n",
dspTreeID(tree), compCurBB->bbNum, key, tree->GetCostEx(), compCurBB->getBBWeight(this));
}
#endif
return 0;
}
else // newCSE is true
Expand All @@ -801,10 +808,13 @@ unsigned Compiler::optValnumCSE_Index(GenTree* tree, Statement* stmt)

if (optCSECandidateCount == MAX_CSE_CNT)
{
Metrics.CseDeniedCount++;
#ifdef DEBUG
if (verbose)
{
printf("Exceeded the MAX_CSE_CNT, not using tree:\n");
printf("CSE budget exhausted: repeated occurrence [%06u] in " FMT_BB
", key %zx, cost %u, weight %f; no candidate slot:\n",
dspTreeID(tree), compCurBB->bbNum, key, tree->GetCostEx(), compCurBB->getBBWeight(this));
gtDispTree(tree);
}
#endif // DEBUG
Expand Down Expand Up @@ -5920,6 +5930,14 @@ PhaseStatus Compiler::optOptimizeValnumCSEs()
optValnumCSE_Heuristic(heuristic);
}

#ifdef DEBUG
if (optCSECandidateCount == MAX_CSE_CNT)
{
JITDUMP("CSE candidate budget: %u/%u slots; %d repeated occurrences denied a slot.\n", optCSECandidateCount,
MAX_CSE_CNT, Metrics.CseDeniedCount);
}
#endif

optValnumCSE_phase = false;

return heuristic->MadeChanges() ? PhaseStatus::MODIFIED_EVERYTHING : PhaseStatus::MODIFIED_NOTHING;
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/jit/optcse.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ class CSE_HeuristicParameterized : public CSE_HeuristicCommon
{
numParameters = 25,
booleanScale = 5,
maxSteps = 65, // MAX_CSE_CNT + 1 (for stopping)
maxSteps = 128, // MAX_CSE_CNT + 1 (for stopping)
};

static double s_defaultParameters[numParameters];
Expand Down
Loading