Skip to content

Commit

Permalink
Refactor fgValueNumberBlockAssignment (#64110)
Browse files Browse the repository at this point in the history
"fgValueNumberBlockAssignment" had a very interesting oddity:
it re-VNs the source tree of the assignment. This is unnecessary,
and is in fact a pessimization, as it means we will fail to VN
assignments from sources it does not understand. This change
fixes that, bringing along some positive diffs from numbering
stores from field indirections.

"fgValueNumberBlockAssignment" also needs to maintaint the
invariant that a location's VN will always match its type.
It was failing to do that in cases where the assignment's
source was not local. This change fixes that.

Finally, this change unifies the code common to numbering
"CopyBlk" and "InitBlk" cases. There is no need for them to
be different.
  • Loading branch information
SingleAccretion authored Feb 3, 2022
1 parent 9a10cec commit c85f02d
Show file tree
Hide file tree
Showing 2 changed files with 162 additions and 309 deletions.
2 changes: 1 addition & 1 deletion src/coreclr/jit/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -5506,7 +5506,7 @@ class Compiler
// Does value-numbering for a block assignment.
void fgValueNumberBlockAssignment(GenTree* tree);

bool fgValueNumberIsStructReinterpretation(GenTreeLclVarCommon* lhsLclVarTree, GenTreeLclVarCommon* rhsLclVarTree);
bool fgValueNumberBlockAssignmentTypeCheck(LclVarDsc* dstVarDsc, FieldSeqNode* dstFldSeq, GenTree* src);

// Does value-numbering for a cast tree.
void fgValueNumberCastTree(GenTree* tree);
Expand Down
Loading

0 comments on commit c85f02d

Please sign in to comment.