File tree 1 file changed +11
-11
lines changed
1 file changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -4216,20 +4216,20 @@ AssertionIndex Compiler::optGlobalAssertionIsEqualOrNotEqual(ASSERT_VALARG_TP as
4216
4216
return assertionIndex;
4217
4217
}
4218
4218
4219
- // Look for matching exact type assertions based on vtable accesses
4219
+ // Look for matching exact type assertions based on vtable accesses. E.g.:
4220
+ //
4221
+ // op1: VNF_InvariantLoad(myObj) or in other words: a vtable access
4222
+ // op2: 'MyType' class handle
4223
+ // Assertion: 'myObj's type is exactly MyType
4224
+ //
4220
4225
if ((curAssertion->assertionKind == OAK_EQUAL) && (curAssertion->op1 .kind == O1K_EXACT_TYPE) &&
4221
- op1->OperIs (GT_IND ))
4226
+ (curAssertion-> op2 . vn == vnStore-> VNConservativeNormalValue (op2-> gtVNPair )) && op1->TypeIs (TYP_I_IMPL ))
4222
4227
{
4223
- GenTree* indirAddr = op1-> AsIndir ()-> Addr () ;
4224
-
4225
- if (indirAddr-> OperIs (GT_LCL_VAR ) && (indirAddr-> TypeGet () == TYP_REF ))
4228
+ VNFuncApp funcApp ;
4229
+ if (vnStore-> GetVNFunc (vnStore-> VNConservativeNormalValue (op1-> gtVNPair ), &funcApp) &&
4230
+ (funcApp. m_func == VNF_InvariantLoad ) && (curAssertion-> op1 . vn == funcApp. m_args [ 0 ] ))
4226
4231
{
4227
- // op1 is accessing vtable of a ref type local var
4228
- if ((curAssertion->op1 .vn == vnStore->VNConservativeNormalValue (indirAddr->gtVNPair )) &&
4229
- (curAssertion->op2 .vn == vnStore->VNConservativeNormalValue (op2->gtVNPair )))
4230
- {
4231
- return assertionIndex;
4232
- }
4232
+ return assertionIndex;
4233
4233
}
4234
4234
}
4235
4235
}
You can’t perform that action at this time.
0 commit comments