@@ -12189,7 +12189,7 @@ GenTree* Compiler::gtFoldTypeEqualityCall(CorInfoIntrinsics methodID, GenTree* o
12189
12189
// The method must be be a type equality intrinsic
12190
12190
assert(methodID == CORINFO_INTRINSIC_TypeEQ || methodID == CORINFO_INTRINSIC_TypeNEQ);
12191
12191
12192
- if ((gtCanOptimizeTypeEquality (op1) == TPK_Unknown) && (gtCanOptimizeTypeEquality (op2) == TPK_Unknown))
12192
+ if ((gtGetTypeProducerKind (op1) == TPK_Unknown) && (gtGetTypeProducerKind (op2) == TPK_Unknown))
12193
12193
{
12194
12194
return nullptr;
12195
12195
}
@@ -12306,23 +12306,23 @@ GenTree* Compiler::gtFoldTypeCompare(GenTree* tree)
12306
12306
12307
12307
// Screen for the right kinds of operands
12308
12308
GenTree* const op1 = tree->gtOp.gtOp1;
12309
- const TypeProducerKind op1Kind = gtCanOptimizeTypeEquality (op1);
12309
+ const TypeProducerKind op1Kind = gtGetTypeProducerKind (op1);
12310
12310
if (op1Kind == TPK_Unknown)
12311
12311
{
12312
12312
return tree;
12313
12313
}
12314
12314
12315
12315
GenTree* const op2 = tree->gtOp.gtOp2;
12316
- const TypeProducerKind op2Kind = gtCanOptimizeTypeEquality (op2);
12316
+ const TypeProducerKind op2Kind = gtGetTypeProducerKind (op2);
12317
12317
if (op2Kind == TPK_Unknown)
12318
12318
{
12319
12319
return tree;
12320
12320
}
12321
12321
12322
12322
// We must have a handle on one side or the other here to optimize,
12323
12323
// otherwise we can't be sure that optimizing is sound.
12324
- const bool op1IsFromHandle = op1Kind == TPK_Handle;
12325
- const bool op2IsFromHandle = op2Kind == TPK_Handle;
12324
+ const bool op1IsFromHandle = ( op1Kind == TPK_Handle) ;
12325
+ const bool op2IsFromHandle = ( op2Kind == TPK_Handle) ;
12326
12326
12327
12327
if (!(op1IsFromHandle || op2IsFromHandle))
12328
12328
{
@@ -12432,13 +12432,8 @@ GenTree* Compiler::gtFoldTypeCompare(GenTree* tree)
12432
12432
// opHandleArgument is the method table we're looking for.
12433
12433
GenTree* const knownMT = opHandleArgument;
12434
12434
12435
- #ifdef LEGACY_BACKEND
12436
- // Fetch object method table from the object itself
12437
- GenTree* const objMT = gtNewOperNode(GT_IND, TYP_I_IMPL, opOther->gtCall.gtCallObjp);
12438
- #else
12439
12435
// Fetch object method table from the object itself
12440
12436
GenTree* const objMT = gtNewOperNode(GT_IND, TYP_I_IMPL, opOther->gtUnOp.gtOp1);
12441
- #endif
12442
12437
12443
12438
// Update various flags
12444
12439
objMT->gtFlags |= GTF_EXCEPT;
@@ -15416,8 +15411,8 @@ void Compiler::gtCheckQuirkAddrExposedLclVar(GenTreePtr tree, GenTreeStack* pare
15416
15411
}
15417
15412
15418
15413
//------------------------------------------------------------------------
15419
- // gtCanOptimizeTypeEquality: check if tree is a suitable input for type
15420
- // equality optimization
15414
+ // gtGetTypeProducerKind: determine if a tree produces a runtime type, and
15415
+ // if so, how.
15421
15416
//
15422
15417
// Arguments:
15423
15418
// tree - tree to examine
@@ -15443,7 +15438,7 @@ void Compiler::gtCheckQuirkAddrExposedLclVar(GenTreePtr tree, GenTreeStack* pare
15443
15438
//
15444
15439
// into a method call.
15445
15440
15446
- Compiler::TypeProducerKind Compiler::gtCanOptimizeTypeEquality (GenTree* tree)
15441
+ Compiler::TypeProducerKind Compiler::gtGetTypeProducerKind (GenTree* tree)
15447
15442
{
15448
15443
if (tree->gtOper == GT_CALL)
15449
15444
{
0 commit comments