From 4070994640bcc2c4c138b6f695d3fce14ea3efe7 Mon Sep 17 00:00:00 2001 From: Eugene Rozenfeld Date: Tue, 29 Jan 2019 11:26:49 -0800 Subject: Remove GTF_ADDR_ONSTACK and IsVarAddr. IsVarAddr was checking GTF_ADDR_ONSTACK to determine if the GT_ADDR node is an address of a local. This change removes both GTF_ADDR_ONSTACK and IsVarAddr and uses IsLocalAdrExpr instead. IsLocalAddrExpr uses opcodes to determine if GT_ADDR node is a local address. GTF_ADDR_ONSTACK flag is ancient, added before 2002 so I couldn't find the checkin that introduced it. I changed the assert to a check and an assignment since simplifications inside fgMorphArgs between https://github.com/dotnet/coreclr/blob/1a1e4c4d5a8030cb8d82a2e5b06c2ab357b92534/src/jit/morph.cpp#L3709 (which causes https://github.com/dotnet/coreclr/blob/1a1e4c4d5a8030cb8d82a2e5b06c2ab357b92534/src/jit/morph.cpp#L3057) and https://github.com/dotnet/coreclr/blob/1a1e4c4d5a8030cb8d82a2e5b06c2ab357b92534/src/jit/morph.cpp#L3790 may result in more GT_ADDR nodes recognized by IsLocalAdrExpr. x86 and x64 pmi frameworks had no code diffs and some gcinfo reductions (15 methods with gcinfo diffs in x86). Fixes #22190. --- src/jit/morph.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/jit/morph.cpp') diff --git a/src/jit/morph.cpp b/src/jit/morph.cpp index efe8ec9fe8..f83fdaeb17 100644 --- a/src/jit/morph.cpp +++ b/src/jit/morph.cpp @@ -1619,7 +1619,7 @@ void fgArgInfo::ArgsComplete() case 7: // If we have a stack based LclVar we can perform a wider read of 4 or 8 bytes // - if (argObj->gtObj.gtOp1->IsVarAddr() == false) // Is the source not a LclVar? + if (argObj->gtObj.gtOp1->IsLocalAddrExpr() == nullptr) // Is the source not a LclVar? { // If we don't have a LclVar we need to read exactly 3,5,6 or 7 bytes // For now we use a a GT_CPBLK to copy the exact size into a GT_LCL_VAR temp. @@ -3052,7 +3052,7 @@ void Compiler::fgInitArgInfo(GenTreeCall* call) // Change the node to TYP_I_IMPL so we don't report GC info // NOTE: We deferred this from the importer because of the inliner. - if (argx->IsVarAddr()) + if (argx->IsLocalAddrExpr() != nullptr) { argx->gtType = TYP_I_IMPL; } @@ -3786,8 +3786,10 @@ GenTreeCall* Compiler::fgMorphArgs(GenTreeCall* call) assert(size != 0); argSlots += argEntry->getSlotCount(); - // lclVar address should have been retyped to TYP_I_IMPL. - assert(!argx->IsVarAddr() || (argx->gtType == TYP_I_IMPL)); + if (argx->IsLocalAddrExpr() != nullptr) + { + argx->gtType = TYP_I_IMPL; + } // Get information about this argument. var_types hfaType = argEntry->hfaType; @@ -4077,7 +4079,7 @@ GenTreeCall* Compiler::fgMorphArgs(GenTreeCall* call) // There are a few special cases where we can omit using a CopyBlk // where we normally would need to use one. - if (argObj->gtObj.gtOp1->IsVarAddr()) // Is the source a LclVar? + if (argObj->gtObj.gtOp1->IsLocalAddrExpr() != nullptr) // Is the source a LclVar? { copyBlkClass = NO_CLASS_HANDLE; } -- cgit v1.2.3