From d9354f2210c647aca369ccb57a77b78b360a888b Mon Sep 17 00:00:00 2001 From: Steven He Date: Sun, 3 Nov 2024 03:06:01 +0900 Subject: [PATCH] More fixes --- src/coreclr/jit/importer.cpp | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/src/coreclr/jit/importer.cpp b/src/coreclr/jit/importer.cpp index 60041dd5f9d550..656fa543e5c264 100644 --- a/src/coreclr/jit/importer.cpp +++ b/src/coreclr/jit/importer.cpp @@ -611,6 +611,22 @@ bool Compiler::impGetLclVal(GenTreeLclVar* tree, GenTree** val) Compiler* comp = this; + auto setCompForLcl = [&comp](unsigned lclNum) { + if (comp->compIsForInlining()) + { + for (unsigned i = 0; i < comp->impInlineInfo->argCnt; i++) + { + if (comp->impInlineInfo->inlArgInfo[i].argTmpNum == lclNum) + { + comp = comp->impInlineInfo->InlinerCompiler; + break; + } + } + } + }; + + setCompForLcl(tree->GetLclNum()); + JITDUMP("\n"); while (true) @@ -631,17 +647,7 @@ bool Compiler::impGetLclVal(GenTreeLclVar* tree, GenTree** val) } else if (gtVal->OperIs(GT_LCL_VAR)) { - if (comp->compIsForInlining()) - { - for (unsigned i = 0; i < comp->impInlineInfo->argCnt; i++) - { - if (comp->impInlineInfo->inlArgInfo[i].argTmpNum == gtVal->AsLclVar()->GetLclNum()) - { - comp = comp->impInlineInfo->InlinerCompiler; - break; - } - } - } + setCompForLcl(gtVal->AsLclVar()->GetLclNum()); tree = gtVal->AsLclVar(); continue; }