Skip to content

Commit a7f3df9

Browse files
Delete gtGetStructHandle and friends (#84212)
* Delete gtGetStructHandle[IfPresent] Replaced with GenTree::GetLayout. * Delete the canonical handle logic * Delete handle handling from fgMakeMultiUse * Delete gtGetStructHandleForSIMD and friends * Delete now-unused SIMD cache entries * Fix SIMD * Fix fgMakeMultiUse * Delete the IsSimdAsHWIntrinsic logic No longer needed. * Fix formatting
1 parent 053e17a commit a7f3df9

13 files changed

+699
-1519
lines changed

src/coreclr/jit/compiler.h

Lines changed: 47 additions & 312 deletions
Large diffs are not rendered by default.

src/coreclr/jit/fginline.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1658,14 +1658,12 @@ Statement* Compiler::fgInlinePrependStatements(InlineInfo* inlineInfo)
16581658

16591659
if (varTypeIsStruct(argType))
16601660
{
1661-
structHnd = gtGetStructHandleIfPresent(argNode);
1662-
noway_assert((structHnd != NO_CLASS_HANDLE) || (argType != TYP_STRUCT));
1661+
structHnd = lclVarInfo[argNum].lclVerTypeInfo.GetClassHandleForValueClass();
1662+
assert(structHnd != NO_CLASS_HANDLE);
16631663
}
16641664

1665-
// Unsafe value cls check is not needed for
1666-
// argTmpNum here since in-linee compiler instance
1667-
// would have iterated over these and marked them
1668-
// accordingly.
1665+
// Unsafe value cls check is not needed for argTmpNum here since in-linee compiler instance
1666+
// would have iterated over these and marked them accordingly.
16691667
impAssignTempGen(tmpNum, argNode, structHnd, CHECK_SPILL_NONE, &afterStmt, callDI, block);
16701668

16711669
// We used to refine the temp type here based on

src/coreclr/jit/flowgraph.cpp

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2146,16 +2146,7 @@ GenTree* Compiler::fgCreateMonitorTree(unsigned lvaMonAcquired, unsigned lvaThis
21462146
// ret(...) ->
21472147
// ret(comma(comma(tmp=...,call mon_exit), tmp))
21482148
//
2149-
//
2150-
// Before morph stage, it is possible to have a case of GT_RETURN(TYP_LONG, op1) where op1's type is
2151-
// TYP_STRUCT (of 8-bytes) and op1 is call node. See the big comment block in impReturnInstruction()
2152-
// for details for the case where info.compRetType is not the same as info.compRetNativeType. For
2153-
// this reason pass compMethodInfo->args.retTypeClass which is guaranteed to be a valid class handle
2154-
// if the return type is a value class. Note that fgInsertCommFormTemp() in turn uses this class handle
2155-
// if the type of op1 is TYP_STRUCT to perform lvaSetStruct() on the new temp that is created, which
2156-
// in turn passes it to VM to know the size of value type.
2157-
GenTree* temp = fgInsertCommaFormTemp(&retNode->AsOp()->gtOp1, info.compMethodInfo->args.retTypeClass);
2158-
2149+
GenTree* temp = fgInsertCommaFormTemp(&retNode->AsOp()->gtOp1);
21592150
GenTree* lclVar = retNode->AsOp()->gtOp1->AsOp()->gtOp2;
21602151

21612152
// The return can't handle all of the trees that could be on the right-hand-side of an assignment,

src/coreclr/jit/gentree.cpp

Lines changed: 363 additions & 639 deletions
Large diffs are not rendered by default.

src/coreclr/jit/gentree.h

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -571,9 +571,6 @@ enum GenTreeFlags : unsigned int
571571
GTF_MDARRLEN_NONFAULTING = 0x20000000, // GT_MDARR_LENGTH -- An MD array length operation that cannot fault. Same as GT_IND_NONFAULTING.
572572

573573
GTF_MDARRLOWERBOUND_NONFAULTING = 0x20000000, // GT_MDARR_LOWER_BOUND -- An MD array lower bound operation that cannot fault. Same as GT_IND_NONFAULTING.
574-
575-
GTF_SIMDASHW_OP = 0x80000000, // GT_HWINTRINSIC -- Indicates that the structHandle should be gotten from gtGetStructHandleForSIMD
576-
// rather than from gtGetStructHandleForHWSIMD.
577574
};
578575

579576
inline constexpr GenTreeFlags operator ~(GenTreeFlags a)
@@ -6161,11 +6158,10 @@ struct GenTreeHWIntrinsic : public GenTreeJitIntrinsic
61616158
IntrinsicNodeBuilder&& nodeBuilder,
61626159
NamedIntrinsic hwIntrinsicID,
61636160
CorInfoType simdBaseJitType,
6164-
unsigned simdSize,
6165-
bool isSimdAsHWIntrinsic)
6161+
unsigned simdSize)
61666162
: GenTreeJitIntrinsic(GT_HWINTRINSIC, type, std::move(nodeBuilder), simdBaseJitType, simdSize)
61676163
{
6168-
Initialize(hwIntrinsicID, isSimdAsHWIntrinsic);
6164+
Initialize(hwIntrinsicID);
61696165
}
61706166

61716167
template <typename... Operands>
@@ -6174,11 +6170,10 @@ struct GenTreeHWIntrinsic : public GenTreeJitIntrinsic
61746170
NamedIntrinsic hwIntrinsicID,
61756171
CorInfoType simdBaseJitType,
61766172
unsigned simdSize,
6177-
bool isSimdAsHWIntrinsic,
61786173
Operands... operands)
61796174
: GenTreeJitIntrinsic(GT_HWINTRINSIC, type, allocator, simdBaseJitType, simdSize, operands...)
61806175
{
6181-
Initialize(hwIntrinsicID, isSimdAsHWIntrinsic);
6176+
Initialize(hwIntrinsicID);
61826177
}
61836178

61846179
#if DEBUGGABLE_GENTREE
@@ -6191,11 +6186,6 @@ struct GenTreeHWIntrinsic : public GenTreeJitIntrinsic
61916186
bool OperIsMemoryStore(GenTree** pAddr = nullptr) const;
61926187
bool OperIsMemoryLoadOrStore() const;
61936188

6194-
bool IsSimdAsHWIntrinsic() const
6195-
{
6196-
return (gtFlags & GTF_SIMDASHW_OP) != 0;
6197-
}
6198-
61996189
unsigned GetResultOpNumForFMA(GenTree* use, GenTree* op1, GenTree* op2, GenTree* op3);
62006190

62016191
ClassLayout* GetLayout(Compiler* compiler) const;
@@ -6289,7 +6279,7 @@ struct GenTreeHWIntrinsic : public GenTreeJitIntrinsic
62896279
private:
62906280
void SetHWIntrinsicId(NamedIntrinsic intrinsicId);
62916281

6292-
void Initialize(NamedIntrinsic intrinsicId, bool isSimdAsHWIntrinsic)
6282+
void Initialize(NamedIntrinsic intrinsicId)
62936283
{
62946284
SetHWIntrinsicId(intrinsicId);
62956285

@@ -6305,11 +6295,6 @@ struct GenTreeHWIntrinsic : public GenTreeJitIntrinsic
63056295
gtFlags |= GTF_ASG;
63066296
}
63076297
}
6308-
6309-
if (isSimdAsHWIntrinsic)
6310-
{
6311-
gtFlags |= GTF_SIMDASHW_OP;
6312-
}
63136298
}
63146299
};
63156300
#endif // FEATURE_HW_INTRINSICS

0 commit comments

Comments
 (0)