diff options
author | Eugene Rozenfeld <erozen@microsoft.com> | 2019-01-29 11:26:49 -0800 |
---|---|---|
committer | Eugene Rozenfeld <erozen@microsoft.com> | 2019-01-30 14:10:49 -0800 |
commit | 4070994640bcc2c4c138b6f695d3fce14ea3efe7 (patch) | |
tree | 3f2bc61d4bec7bc503fb0c7fda3fed92898a1fc3 /src/jit/importer.cpp | |
parent | 91e1ffccc38fc87f6f496eb056396a1b775f08af (diff) | |
download | coreclr-4070994640bcc2c4c138b6f695d3fce14ea3efe7.tar.gz coreclr-4070994640bcc2c4c138b6f695d3fce14ea3efe7.tar.bz2 coreclr-4070994640bcc2c4c138b6f695d3fce14ea3efe7.zip |
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.
Diffstat (limited to 'src/jit/importer.cpp')
-rw-r--r-- | src/jit/importer.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/jit/importer.cpp b/src/jit/importer.cpp index e02eaec0d5..163779c72a 100644 --- a/src/jit/importer.cpp +++ b/src/jit/importer.cpp @@ -2928,12 +2928,12 @@ CORINFO_CLASS_HANDLE Compiler::impGetObjectClass() /* static */ void Compiler::impBashVarAddrsToI(GenTree* tree1, GenTree* tree2) { - if (tree1->IsVarAddr()) + if (tree1->IsLocalAddrExpr() != nullptr) { tree1->gtType = TYP_I_IMPL; } - if (tree2 && tree2->IsVarAddr()) + if (tree2 && (tree2->IsLocalAddrExpr() != nullptr)) { tree2->gtType = TYP_I_IMPL; } @@ -11442,7 +11442,7 @@ void Compiler::impImportBlockCode(BasicBlock* block) // We had better assign it a value of the correct type assertImp( genActualType(lclTyp) == genActualType(op1->gtType) || - genActualType(lclTyp) == TYP_I_IMPL && op1->IsVarAddr() || + genActualType(lclTyp) == TYP_I_IMPL && (op1->IsLocalAddrExpr() != nullptr) || (genActualType(lclTyp) == TYP_I_IMPL && (op1->gtType == TYP_BYREF || op1->gtType == TYP_REF)) || (genActualType(op1->gtType) == TYP_I_IMPL && lclTyp == TYP_BYREF) || (varTypeIsFloating(lclTyp) && varTypeIsFloating(op1->TypeGet())) || @@ -11451,7 +11451,7 @@ void Compiler::impImportBlockCode(BasicBlock* block) /* If op1 is "&var" then its type is the transient "*" and it can be used either as TYP_BYREF or TYP_I_IMPL */ - if (op1->IsVarAddr()) + if (op1->IsLocalAddrExpr() != nullptr) { assertImp(genActualType(lclTyp) == TYP_I_IMPL || lclTyp == TYP_BYREF); @@ -12247,7 +12247,7 @@ void Compiler::impImportBlockCode(BasicBlock* block) op3 = impPopStack().val; assertImp(op3->gtType == TYP_REF); - if (op2->IsVarAddr()) + if (op2->IsLocalAddrExpr() != nullptr) { op2->gtType = TYP_I_IMPL; } @@ -19148,7 +19148,7 @@ void Compiler::impInlineInitVars(InlineInfo* pInlineInfo) assert(sigType == TYP_I_IMPL); /* If possible change the BYREF to an int */ - if (thisArg->IsVarAddr()) + if (thisArg->IsLocalAddrExpr() != nullptr) { thisArg->gtType = TYP_I_IMPL; lclVarInfo[0].lclVerTypeInfo = typeInfo(varType2tiType(TYP_I_IMPL)); @@ -19230,7 +19230,7 @@ void Compiler::impInlineInitVars(InlineInfo* pInlineInfo) assert(varTypeIsIntOrI(sigType)); /* If possible bash the BYREF to an int */ - if (inlArgNode->IsVarAddr()) + if (inlArgNode->IsLocalAddrExpr() != nullptr) { inlArgNode->gtType = TYP_I_IMPL; lclVarInfo[i].lclVerTypeInfo = typeInfo(varType2tiType(TYP_I_IMPL)); |