From cc140fc716a8363f6dcd4a0a25b15e46fc78955d Mon Sep 17 00:00:00 2001 From: SingleAccretion <62474226+SingleAccretion@users.noreply.github.com> Date: Mon, 24 Oct 2022 21:30:45 +0300 Subject: [PATCH] Update def flags in gtCloneExpr (#77378) Limit to cases where are actually performing replacements to mitigate TP impact. --- 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 a513dc7eeeca8..32aa1633c84ee 100644 --- a/src/coreclr/jit/gentree.cpp +++ b/src/coreclr/jit/gentree.cpp @@ -8777,6 +8777,10 @@ GenTree* Compiler::gtCloneExpr( // Update side effect flags since they may be different from the source side effect flags. // For example, we may have replaced some locals with constants and made indirections non-throwing. gtUpdateNodeSideEffects(copy); + if ((varNum != BAD_VAR_NUM) && copy->OperIsSsaDef()) + { + fgAssignSetVarDef(copy); + } } /* GTF_COLON_COND should be propagated from 'tree' to 'copy' */