Skip to content

Commit

Permalink
Don't use GT_ARR_ELEM as a location/value (#54780)
Browse files Browse the repository at this point in the history
* Don't use GT_ARR_ELEM as a location

It represents an address.

No diffs.

* Clarify the purpose of GenTreeArrElem
  • Loading branch information
SingleAccretion authored Jul 8, 2021
1 parent f3b7775 commit fdbca22
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 13 deletions.
7 changes: 0 additions & 7 deletions src/coreclr/jit/assertionprop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1248,13 +1248,6 @@ AssertionIndex Compiler::optCreateAssertion(GenTree* op1,
toType = op2->gtType;
goto SUBRANGE_COMMON;

case GT_ARR_ELEM:

/* Assigning the result of an indirection into a LCL_VAR, see if we can add a subrange assertion */

toType = op2->gtType;
goto SUBRANGE_COMMON;

case GT_LCL_FLD:

/* Assigning the result of an indirection into a LCL_VAR, see if we can add a subrange assertion */
Expand Down
1 change: 0 additions & 1 deletion src/coreclr/jit/gcinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,6 @@ GCInfo::WriteBarrierForm GCInfo::gcIsWriteBarrierCandidate(GenTree* tgt, GenTree
case GT_LEA:
return gcWriteBarrierFormFromTargetAddress(tgt->AsAddrMode()->Base());

case GT_ARR_ELEM: /* Definitely in the managed heap */
case GT_CLS_VAR:
return WBF_BarrierUnchecked;

Expand Down
8 changes: 4 additions & 4 deletions src/coreclr/jit/gentree.h
Original file line number Diff line number Diff line change
Expand Up @@ -5366,9 +5366,9 @@ struct GenTreeBoundsChk : public GenTree
}
};

// gtArrElem -- general array element (GT_ARR_ELEM), for non "SZ_ARRAYS"
// -- multidimensional arrays, or 1-d arrays with non-zero lower bounds.

// GenTreeArrElem - bounds checked address (byref) of a general array element,
// for multidimensional arrays, or 1-d arrays with non-zero lower bounds.
//
struct GenTreeArrElem : public GenTree
{
GenTree* gtArrObj;
Expand All @@ -5384,7 +5384,7 @@ struct GenTreeArrElem : public GenTree
// This has caused VSW 571394.
var_types gtArrElemType; // The array element type

// Requires that "inds" is a pointer to an array of "rank" GenTreePtrs for the indices.
// Requires that "inds" is a pointer to an array of "rank" nodes for the indices.
GenTreeArrElem(
var_types type, GenTree* arr, unsigned char rank, unsigned char elemSize, var_types elemType, GenTree** inds)
: GenTree(GT_ARR_ELEM, type), gtArrObj(arr), gtArrRank(rank), gtArrElemSize(elemSize), gtArrElemType(elemType)
Expand Down
1 change: 0 additions & 1 deletion src/coreclr/jit/morph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,6 @@ GenTree* Compiler::fgMorphCast(GenTree* tree)
case GT_IND:
case GT_CLS_VAR:
case GT_LCL_FLD:
case GT_ARR_ELEM:
oper->gtType = dstType;
// We're changing the type here so we need to update the VN;
// in other cases we discard the cast without modifying oper
Expand Down

0 comments on commit fdbca22

Please sign in to comment.