Skip to content

Commit b378823

Browse files
authored
JIT: make non-null assertions about all indir addr types (#113772)
Instead of just GC types. This removes some gratuitous diffs when escape analysis can retype a ref or byref to long. Also remove obsolete (?) block for TYP_LONG assertions.
1 parent 1f76c1f commit b378823

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

src/coreclr/jit/assertionprop.cpp

+1-13
Original file line numberDiff line numberDiff line change
@@ -1136,14 +1136,10 @@ AssertionIndex Compiler::optCreateAssertion(GenTree* op1, GenTree* op2, optAsser
11361136
}
11371137
//
11381138
// Are we trying to make a non-null assertion?
1139+
// (note we now do this for all indirs, regardless of address type)
11391140
//
11401141
else if (op2 == nullptr)
11411142
{
1142-
if (!varTypeIsGC(op1))
1143-
{
1144-
return NO_ASSERTION_INDEX; // Don't make an assertion
1145-
}
1146-
11471143
// Must be an OAK_NOT_EQUAL assertion
11481144
assert(assertionKind == OAK_NOT_EQUAL);
11491145

@@ -1242,14 +1238,6 @@ AssertionIndex Compiler::optCreateAssertion(GenTree* op1, GenTree* op2, optAsser
12421238
goto DONE_ASSERTION; // Don't make an assertion
12431239
}
12441240

1245-
// If the LclVar is a TYP_LONG then we only make
1246-
// assertions where op2 is also TYP_LONG
1247-
//
1248-
if ((lclVar->TypeGet() == TYP_LONG) && (op2->TypeGet() != TYP_LONG))
1249-
{
1250-
goto DONE_ASSERTION; // Don't make an assertion
1251-
}
1252-
12531241
assertion.op2.kind = op2Kind;
12541242
assertion.op2.vn = optConservativeNormalVN(op2);
12551243

0 commit comments

Comments
 (0)