Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fix formatting and build issues
  • Loading branch information
davidwrighton committed Jul 29, 2020
commit 79c37e7e04aa56011c855675d2dca8f39130bad2
4 changes: 2 additions & 2 deletions src/coreclr/src/jit/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -6366,8 +6366,8 @@ class Compiler
static const size_t s_optCSEhashSize;
static const size_t s_optCSEhashGrowthFactor;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be renamed to indicate that it is the initial hash table size

s_optCSEhashSize => s_optCSEhashSizeInitial

static const size_t s_optCSEhashBucketSize;
size_t optCSEhashSize; // Size of hashtable
size_t optCSEhashCount; // Number of entries in hashtable
size_t optCSEhashSize; // Size of hashtable
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// The current size of the hashtable

size_t optCSEhashCount; // Number of entries in hashtable
size_t optCSEhashMaxCountBeforeResize; // Number of entries before resize
CSEdsc** optCSEhash;
CSEdsc** optCSEtab;
Expand Down
16 changes: 8 additions & 8 deletions src/coreclr/src/jit/optcse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void Compiler::optCSEstop()

CSEdsc* dsc;
CSEdsc** ptr;
unsigned cnt;
size_t cnt;

optCSEtab = new (this, CMK_CSE) CSEdsc*[optCSECandidateCount]();

Expand Down Expand Up @@ -641,13 +641,13 @@ unsigned Compiler::optValnumCSE_Index(GenTree* tree, Statement* stmt)
{
if (optCSEhashCount == optCSEhashMaxCountBeforeResize)
{
size_t newOptCSEhashSize = optCSEhashSize * s_optCSEhashGrowthFactor;
CSEdsc** newOptCSEhash = new (this, CMK_CSE) CSEdsc*[newOptCSEhashSize]();
size_t newOptCSEhashSize = optCSEhashSize * s_optCSEhashGrowthFactor;
CSEdsc** newOptCSEhash = new (this, CMK_CSE) CSEdsc*[newOptCSEhashSize]();

// Iterate through each existing entry, moving to the new table
CSEdsc** ptr;
CSEdsc* dsc;
size_t cnt;
CSEdsc* dsc;
size_t cnt;
for (cnt = optCSEhashSize, ptr = optCSEhash; cnt; cnt--, ptr++)
{
for (dsc = *ptr; dsc;)
Expand All @@ -657,15 +657,15 @@ unsigned Compiler::optValnumCSE_Index(GenTree* tree, Statement* stmt)
size_t newHval = optCSEKeyToHashIndex(dsc->csdHashKey, newOptCSEhashSize);

// Move CSEdsc to bucket in enlarged table
dsc->csdNextInBucket = newOptCSEhash[newHval];
dsc->csdNextInBucket = newOptCSEhash[newHval];
newOptCSEhash[newHval] = dsc;

dsc = nextDsc;
}
}

optCSEhash = newOptCSEhash;
optCSEhashSize = newOptCSEhashSize;
optCSEhash = newOptCSEhash;
optCSEhashSize = newOptCSEhashSize;
optCSEhashMaxCountBeforeResize = optCSEhashMaxCountBeforeResize * s_optCSEhashGrowthFactor;
}

Expand Down