Skip to content

Commit 2659885

Browse files
authored
Store actual signature types in CallArg and normalize to that type (#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.
1 parent afacf6a commit 2659885

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

src/coreclr/jit/importer.cpp

-14
Original file line numberDiff line numberDiff line change
@@ -861,20 +861,6 @@ void Compiler::impPopCallArgs(CORINFO_SIG_INFO* sig, GenTreeCall* call)
861861
// Morph trees that aren't already OBJs or MKREFANY to be OBJs
862862
assert(ti.IsType(TI_STRUCT));
863863

864-
// The argument and parameter types can be different for legitimate
865-
// reasons, but we expect them to be compatible in those cases. One
866-
// example where this happens is when inlining shared code into a
867-
// non-generic function, in which case we might see the __Canon in
868-
// the parameter type but exact types in the signature type.
869-
//
870-
// TODO-ARGS: Remove this quirk; we should be able to use the
871-
// signature type that is different in the rare case above. It will
872-
// cause positive diffs, but that is probably an indication that we
873-
// have downstream phases that should be using
874-
// `ClassLayout::AreCompatible` instead.
875-
//
876-
classHnd = ti.GetClassHandleForValueClass();
877-
878864
bool forceNormalization = false;
879865
if (varTypeIsSIMD(argNode))
880866
{

0 commit comments

Comments
 (0)