From f279e0b17e310865cfeba418355da6793f103020 Mon Sep 17 00:00:00 2001 From: TIHan Date: Fri, 2 Dec 2022 09:36:20 -0800 Subject: [PATCH 1/2] Allow temp assignment whose dstTyp is TYP_I_IMPL and valTyp is GC --- src/coreclr/jit/gentree.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/coreclr/jit/gentree.cpp b/src/coreclr/jit/gentree.cpp index 77b79bf0e77be1..d036c5b7f8e883 100644 --- a/src/coreclr/jit/gentree.cpp +++ b/src/coreclr/jit/gentree.cpp @@ -15683,6 +15683,10 @@ GenTree* Compiler::gtNewTempAssign( { ok = true; } + else if ((dstTyp == TYP_I_IMPL) && varTypeIsGC(valTyp)) + { + ok = true; + } // - TYP_BYREF = TYP_REF when object stack allocation is enabled else if (JitConfig.JitObjectStackAllocation() && (dstTyp == TYP_BYREF) && (valTyp == TYP_REF)) { From 2fded7f44555e35b34e92f4df931183707df97f8 Mon Sep 17 00:00:00 2001 From: TIHan Date: Fri, 2 Dec 2022 09:54:16 -0800 Subject: [PATCH 2/2] Only do this for byref --- src/coreclr/jit/gentree.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/coreclr/jit/gentree.cpp b/src/coreclr/jit/gentree.cpp index d036c5b7f8e883..2dd5ffa7f809c9 100644 --- a/src/coreclr/jit/gentree.cpp +++ b/src/coreclr/jit/gentree.cpp @@ -15683,7 +15683,8 @@ GenTree* Compiler::gtNewTempAssign( { ok = true; } - else if ((dstTyp == TYP_I_IMPL) && varTypeIsGC(valTyp)) + // - TYP_I_IMPL = TYP_BYREF + else if ((dstTyp == TYP_I_IMPL) && (valTyp == TYP_BYREF)) { ok = true; }