diff --git a/src/coreclr/src/jit/importer.cpp b/src/coreclr/src/jit/importer.cpp index c474744aec68e2..6efad156a31d81 100644 --- a/src/coreclr/src/jit/importer.cpp +++ b/src/coreclr/src/jit/importer.cpp @@ -18571,7 +18571,9 @@ void Compiler::impInlineRecordArgInfo(InlineInfo* pInlineInfo, inlCurArgInfo->argNode = curArgVal; GenTree* lclVarTree; - if (impIsAddressInLocal(curArgVal, &lclVarTree) && varTypeIsStruct(lclVarTree)) + + const bool isAddressInLocal = impIsAddressInLocal(curArgVal, &lclVarTree); + if (isAddressInLocal && varTypeIsStruct(lclVarTree)) { inlCurArgInfo->argIsByRefToStructLocal = true; #ifdef FEATURE_SIMD @@ -18596,8 +18598,7 @@ void Compiler::impInlineRecordArgInfo(InlineInfo* pInlineInfo, INDEBUG(curArgVal->AsLclVar()->gtLclILoffs = argNum;) } - if ((curArgVal->OperKind() & GTK_CONST) || - ((curArgVal->gtOper == GT_ADDR) && (curArgVal->AsOp()->gtOp1->gtOper == GT_LCL_VAR))) + if ((curArgVal->OperKind() & GTK_CONST) || isAddressInLocal) { inlCurArgInfo->argIsInvariant = true; if (inlCurArgInfo->argIsThis && (curArgVal->gtOper == GT_CNS_INT) && (curArgVal->AsIntCon()->gtIconVal == 0))