File tree 1 file changed +6
-14
lines changed
1 file changed +6
-14
lines changed Original file line number Diff line number Diff line change @@ -1336,23 +1336,15 @@ AssertionIndex Compiler::optCreateAssertion(GenTree* op1,
1336
1336
1337
1337
if (op2->gtOper == GT_CNS_INT)
1338
1338
{
1339
- ssize_t iconVal = op2->AsIntCon ()->gtIconVal ;
1340
-
1341
- if (varTypeIsSmall (lclVar))
1339
+ ssize_t iconVal = op2->AsIntCon ()->IconValue ();
1340
+ if (varTypeIsSmall (lclVar) && op1->OperIs (GT_STORE_LCL_VAR))
1342
1341
{
1343
1342
iconVal = optCastConstantSmall (iconVal, lclVar->TypeGet ());
1343
+ if (!optLocalAssertionProp)
1344
+ {
1345
+ assertion.op2 .vn = vnStore->VNForIntCon (static_cast <int >(iconVal));
1346
+ }
1344
1347
}
1345
-
1346
- #ifdef TARGET_ARM
1347
- // Do not Constant-Prop large constants for ARM
1348
- // TODO-CrossBitness: we wouldn't need the cast below if GenTreeIntCon::gtIconVal had
1349
- // target_ssize_t type.
1350
- if (!codeGen->validImmForMov ((target_ssize_t )iconVal))
1351
- {
1352
- goto DONE_ASSERTION; // Don't make an assertion
1353
- }
1354
- #endif // TARGET_ARM
1355
-
1356
1348
assertion.op2 .u1 .iconVal = iconVal;
1357
1349
assertion.op2 .SetIconFlag (op2->GetIconHandleFlag (), op2->AsIntCon ()->gtFieldSeq );
1358
1350
}
You can’t perform that action at this time.
0 commit comments