Skip to content

Commit 96e283d

Browse files
authored
JIT: remove unnecessary inlining restriction (#116773)
We can still inline methods even if they make generic virtual calls. Fixes #116740.
1 parent 390d172 commit 96e283d

File tree

2 files changed

+0
-14
lines changed

2 files changed

+0
-14
lines changed

src/coreclr/jit/importercalls.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -180,12 +180,6 @@ var_types Compiler::impImportCall(OPCODE opcode,
180180
compInlineResult->NoteFatal(InlineObservation::CALLEE_HAS_MANAGED_VARARGS);
181181
return TYP_UNDEF;
182182
}
183-
184-
if ((mflags & CORINFO_FLG_VIRTUAL) && (sig->sigInst.methInstCount != 0) && (opcode == CEE_CALLVIRT))
185-
{
186-
compInlineResult->NoteFatal(InlineObservation::CALLEE_IS_GENERIC_VIRTUAL);
187-
return TYP_UNDEF;
188-
}
189183
}
190184

191185
clsHnd = pResolvedToken->hClass;
@@ -381,12 +375,6 @@ var_types Compiler::impImportCall(OPCODE opcode,
381375

382376
case CORINFO_VIRTUALCALL_LDVIRTFTN:
383377
{
384-
if (compIsForInlining())
385-
{
386-
compInlineResult->NoteFatal(InlineObservation::CALLSITE_HAS_CALL_VIA_LDVIRTFTN);
387-
return TYP_UNDEF;
388-
}
389-
390378
assert(!(mflags & CORINFO_FLG_STATIC)); // can't call a static method
391379
assert(!(clsFlags & CORINFO_FLG_VALUECLASS));
392380
// OK, We've been told to call via LDVIRTFTN, so just

src/coreclr/jit/inline.def

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ INLINE_OBSERVATION(HAS_NO_BODY, bool, "has no body",
3939
INLINE_OBSERVATION(HAS_NULL_FOR_LDELEM, bool, "has null pointer for ldelem", FATAL, CALLEE)
4040
INLINE_OBSERVATION(HAS_UNMANAGED_CALLCONV, bool, "has unmanaged calling convention", FATAL, CALLEE)
4141
INLINE_OBSERVATION(IS_ARRAY_METHOD, bool, "is array method", FATAL, CALLEE)
42-
INLINE_OBSERVATION(IS_GENERIC_VIRTUAL, bool, "generic virtual", FATAL, CALLEE)
4342
INLINE_OBSERVATION(IS_JIT_NOINLINE, bool, "noinline per JitNoinline", FATAL, CALLEE)
4443
INLINE_OBSERVATION(IS_NOINLINE, bool, "noinline per IL/cached result", FATAL, CALLEE)
4544
INLINE_OBSERVATION(IS_SYNCHRONIZED, bool, "is synchronized", FATAL, CALLEE)
@@ -137,7 +136,6 @@ INLINE_OBSERVATION(COMPILATION_FAILURE, bool, "failed to compile",
137136
INLINE_OBSERVATION(EXPLICIT_TAIL_PREFIX, bool, "explicit tail prefix", FATAL, CALLSITE)
138137
INLINE_OBSERVATION(EH_TABLE_FULL, bool, "callee has eh, eh table is full", FATAL, CALLSITE)
139138
INLINE_OBSERVATION(GENERIC_DICTIONARY_LOOKUP, bool, "runtime dictionary lookup", FATAL, CALLSITE)
140-
INLINE_OBSERVATION(HAS_CALL_VIA_LDVIRTFTN, bool, "call via ldvirtftn", FATAL, CALLSITE)
141139
INLINE_OBSERVATION(HAS_COMPLEX_HANDLE, bool, "complex handle access", FATAL, CALLSITE)
142140
INLINE_OBSERVATION(IMPLICIT_REC_TAIL_CALL, bool, "implicit recursive tail call", FATAL, CALLSITE)
143141
INLINE_OBSERVATION(IS_CALL_TO_HELPER, bool, "target is helper", FATAL, CALLSITE)

0 commit comments

Comments
 (0)