From: Egor Bogatov Date: Sat, 20 Mar 2021 15:51:16 +0000 (+0300) Subject: Fix incorrect GTF_CALL_M_SPECIAL_INTRINSIC usage (#49911) X-Git-Tag: submit/tizen/20210909.063632~2540 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ff8cfe20025f586293c0b7b533a9745c4f1f378e;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Fix incorrect GTF_CALL_M_SPECIAL_INTRINSIC usage (#49911) * Fix incorrect GTF_CALL_M_SPECIAL_INTRINSIC usage * Update importer.cpp --- diff --git a/src/coreclr/jit/gentree.cpp b/src/coreclr/jit/gentree.cpp index f1b78eb..fa289ce 100644 --- a/src/coreclr/jit/gentree.cpp +++ b/src/coreclr/jit/gentree.cpp @@ -17853,7 +17853,7 @@ CORINFO_CLASS_HANDLE Compiler::gtGetClassHandle(GenTree* tree, bool* pIsExact, b case GT_CALL: { GenTreeCall* call = tree->AsCall(); - if (call->gtFlags & CORINFO_FLG_JIT_INTRINSIC) + if (call->gtCallMoreFlags & GTF_CALL_M_SPECIAL_INTRINSIC) { NamedIntrinsic ni = lookupNamedIntrinsic(call->gtCallMethHnd); if ((ni == NI_System_Array_Clone) || (ni == NI_System_Object_MemberwiseClone)) diff --git a/src/coreclr/jit/importer.cpp b/src/coreclr/jit/importer.cpp index d256d86..4299545 100644 --- a/src/coreclr/jit/importer.cpp +++ b/src/coreclr/jit/importer.cpp @@ -4323,7 +4323,7 @@ GenTree* Compiler::impIntrinsic(GenTree* newobjThis, if (opts.OptimizationEnabled() && impStackTop().val->OperIs(GT_RET_EXPR)) { GenTreeCall* call = impStackTop().val->AsRetExpr()->gtInlineCandidate->AsCall(); - if (call->gtFlags & CORINFO_FLG_JIT_INTRINSIC) + if (call->gtCallMoreFlags & GTF_CALL_M_SPECIAL_INTRINSIC) { if (lookupNamedIntrinsic(call->gtCallMethHnd) == NI_System_Threading_Thread_get_CurrentThread) { @@ -4458,10 +4458,13 @@ GenTree* Compiler::impIntrinsic(GenTree* newobjThis, break; } + case NI_System_Array_Clone: case NI_System_Collections_Generic_Comparer_get_Default: case NI_System_Collections_Generic_EqualityComparer_get_Default: + case NI_System_Object_MemberwiseClone: + case NI_System_Threading_Thread_get_CurrentThread: { - // Flag for later handling during devirtualization. + // Flag for later handling. isSpecial = true; break; }