Skip to content

Commit d950070

Browse files
EgorBoCopilot
andauthored
Fix IsKnownNonNull assert for SIMD base addresses (#129788)
Fixes #129738. I added this assert in #129447, but it turns out we can visit that functions for SIMD values as addresses (e.g. via `fgValueNumberIndirNullCheckExceptions` calls it with a SIMD base address (SVE gather/scatter). --------- Co-authored-by: EgorBo <egorbo@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent bb4ec1f commit d950070

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/coreclr/jit/valuenum.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1619,7 +1619,13 @@ bool ValueNumStore::IsKnownNonNull(ValueNum vn)
16191619
return false;
16201620
}
16211621

1622-
assert((TypeOfVN(vn) == TYP_I_IMPL) || (TypeOfVN(vn) == TYP_REF) || (TypeOfVN(vn) == TYP_BYREF));
1622+
// Ignore corner cases like a SIMD value - SIMD could be a base address of an indirection
1623+
// (e.g. SVE GatherVector, a vector of addresses).
1624+
var_types vnType = TypeOfVN(vn);
1625+
if ((vnType != TYP_I_IMPL) && (vnType != TYP_REF) && (vnType != TYP_BYREF))
1626+
{
1627+
return false;
1628+
}
16231629

16241630
target_ssize_t offset;
16251631
PeelOffsets(&vn, &offset);

0 commit comments

Comments
 (0)