Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/coreclr/jit/importercalls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10420,6 +10420,13 @@ NamedIntrinsic Compiler::lookupNamedIntrinsic(CORINFO_METHOD_HANDLE method)
result = NI_System_Collections_Generic_EqualityComparer_get_Default;
}
}
else if (strcmp(className, "IEnumerable`1") == 0)
{
if (strcmp(methodName, "GetEnumerator") == 0)
{
result = NI_System_Collections_Generic_IEnumerable_GetEnumerator;
}
}
}
else if (strcmp(namespaceName, "Numerics") == 0)
{
Expand Down
3 changes: 2 additions & 1 deletion src/coreclr/jit/namedintrinsiclist.h
Original file line number Diff line number Diff line change
Expand Up @@ -255,10 +255,11 @@ enum NamedIntrinsic : unsigned short
NI_PRIMITIVE_END,

//
// Array Intrinsics
// Enumeration Intrinsics
//
NI_System_SZArrayHelper_GetEnumerator,
NI_System_Array_T_GetEnumerator,
NI_System_Collections_Generic_IEnumerable_GetEnumerator,
};

#endif // _NAMEDINTRINSICLIST_H_
16 changes: 12 additions & 4 deletions src/coreclr/jit/objectalloc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3845,13 +3845,21 @@ bool ObjectAllocator::CheckCanClone(CloneInfo* info)
// (if it does, optimization does not require cloning, as
// there should be only one reaching def...)
//
// For now we're going to just go ahead and clone, despite the
// fact that this is wasteful.
//
// In the transformation that follows the cloned path is the
// "fast" path and gets properly specialized; the original "slow
// path" will become unreachable and get cleaned up later on.
//
// See dotnet/runtime issue #117204.
//
if (comp->m_domTree->Dominates(allocBlock, defBlock))
{
JITDUMP("Unexpected, alloc site " FMT_BB " dominates def block " FMT_BB "\n", allocBlock->bbNum,
defBlock->bbNum);

return false;
JITDUMP("Unexpected, alloc site " FMT_BB " dominates def block " FMT_BB ". We will clone anyways.\n",
allocBlock->bbNum, defBlock->bbNum);
}

// Classify the other local appearances
// as Ts (allocTemps) or Us (useTemps), and look for guard appearances.
//
Expand Down
Loading