Skip to content

Commit

Permalink
Store actual signature types in CallArg and normalize to that type (#…
Browse files Browse the repository at this point in the history
…69969)

Previously, for struct args, we would use the class handle of the
argument (from the IL stack) instead of the class handle from the
signature. These may sometimes differ in __Canon when inlining shared
code. This change switches the class handle stored in CallArg to always
be the type reported back by the EE when asking about the signature.
  • Loading branch information
jakobbotsch authored May 31, 2022
1 parent afacf6a commit 2659885
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions src/coreclr/jit/importer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -861,20 +861,6 @@ void Compiler::impPopCallArgs(CORINFO_SIG_INFO* sig, GenTreeCall* call)
// Morph trees that aren't already OBJs or MKREFANY to be OBJs
assert(ti.IsType(TI_STRUCT));

// The argument and parameter types can be different for legitimate
// reasons, but we expect them to be compatible in those cases. One
// example where this happens is when inlining shared code into a
// non-generic function, in which case we might see the __Canon in
// the parameter type but exact types in the signature type.
//
// TODO-ARGS: Remove this quirk; we should be able to use the
// signature type that is different in the rare case above. It will
// cause positive diffs, but that is probably an indication that we
// have downstream phases that should be using
// `ClassLayout::AreCompatible` instead.
//
classHnd = ti.GetClassHandleForValueClass();

bool forceNormalization = false;
if (varTypeIsSIMD(argNode))
{
Expand Down

0 comments on commit 2659885

Please sign in to comment.