Skip to content

Commit

Permalink
JIT: Remove some fgWalkTree uses (#71767)
Browse files Browse the repository at this point in the history
Convert them to GenTreeVisitor.
  • Loading branch information
jakobbotsch authored Jul 8, 2022
1 parent b132155 commit fdb900e
Show file tree
Hide file tree
Showing 5 changed files with 837 additions and 792 deletions.
34 changes: 13 additions & 21 deletions src/coreclr/jit/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -2702,8 +2702,6 @@ class Compiler

void gtUpdateNodeOperSideEffects(GenTree* tree);

void gtUpdateNodeOperSideEffectsPost(GenTree* tree);

// Returns "true" iff the complexity (not formally defined, but first interpretation
// is #of nodes in subtree) of "tree" is greater than "limit".
// (This is somewhat redundant with the "GetCostEx()/GetCostSz()" fields, but can be used
Expand Down Expand Up @@ -5930,9 +5928,6 @@ class Compiler
bool fgForwardSubBlock(BasicBlock* block);
bool fgForwardSubStatement(Statement* statement);

static fgWalkPreFn fgUpdateSideEffectsPre;
static fgWalkPostFn fgUpdateSideEffectsPost;

// The given local variable, required to be a struct variable, is being assigned via
// a "lclField", to make it masquerade as an integral type in the ABI. Make sure that
// the variable is not enregistered, and is therefore not promoted independently.
Expand Down Expand Up @@ -6468,7 +6463,7 @@ class Compiler
int arrayLengthCount;
};

static fgWalkResult optInvertCountTreeInfo(GenTree** pTree, fgWalkData* data);
OptInvertCountTreeInfoType optInvertCountTreeInfo(GenTree* tree);

bool optInvertWhileLoop(BasicBlock* block);

Expand All @@ -6486,9 +6481,19 @@ class Compiler
bool dupCond,
unsigned* iterCount);

static fgWalkPreFn optIsVarAssgCB;

protected:
struct isVarAssgDsc
{
GenTree* ivaSkip;
ALLVARSET_TP ivaMaskVal; // Set of variables assigned to. This is a set of all vars, not tracked vars.
unsigned ivaVar; // Variable we are interested in, or -1
varRefKinds ivaMaskInd; // What kind of indirect assignments are there?
callInterf ivaMaskCall; // What kind of calls are there?
bool ivaMaskIncomplete; // Variables not representable in ivaMaskVal were assigned to.
};

bool optIsVarAssignedWithDesc(Statement* stmt, isVarAssgDsc* dsc);

bool optIsVarAssigned(BasicBlock* beg, BasicBlock* end, GenTree* skip, unsigned var);

bool optIsVarAssgLoop(unsigned lnum, unsigned var);
Expand Down Expand Up @@ -6735,19 +6740,6 @@ class Compiler

void optOptimizeCSEs();

struct isVarAssgDsc
{
GenTree* ivaSkip;
ALLVARSET_TP ivaMaskVal; // Set of variables assigned to. This is a set of all vars, not tracked vars.
#ifdef DEBUG
void* ivaSelf;
#endif
unsigned ivaVar; // Variable we are interested in, or -1
varRefKinds ivaMaskInd; // What kind of indirect assignments are there?
callInterf ivaMaskCall; // What kind of calls are there?
bool ivaMaskIncomplete; // Variables not representable in ivaMaskVal were assigned to.
};

static callInterf optCallInterf(GenTreeCall* call);

public:
Expand Down
Loading

0 comments on commit fdb900e

Please sign in to comment.