From 33564f004584b6795a8953d3ceaa57621fc19baa Mon Sep 17 00:00:00 2001 From: Sergey Andreenko Date: Mon, 30 Oct 2017 10:45:53 -0700 Subject: [PATCH] delete unused functions and arguments in lower. (dotnet/coreclr#14726) * move putArg inside * delete unused function LowerPutArgStk with two arguments was never used. * delete extra argument Commit migrated from https://github.com/dotnet/coreclr/commit/cd9c0ed411daf8a83baa705a9e54870ecdf95e9f --- src/coreclr/src/jit/lower.cpp | 20 +++++++------------- src/coreclr/src/jit/lower.h | 10 ++-------- 2 files changed, 9 insertions(+), 21 deletions(-) diff --git a/src/coreclr/src/jit/lower.cpp b/src/coreclr/src/jit/lower.cpp index d818088b253..ba3e37c0846 100644 --- a/src/coreclr/src/jit/lower.cpp +++ b/src/coreclr/src/jit/lower.cpp @@ -1265,8 +1265,6 @@ void Lowering::LowerArg(GenTreeCall* call, GenTreePtr* ppArg) #endif // defined(_TARGET_X86_) #endif // defined(FEATURE_SIMD) - GenTreePtr putArg; - // If we hit this we are probably double-lowering. assert(!arg->OperIsPutArg()); @@ -1284,7 +1282,7 @@ void Lowering::LowerArg(GenTreeCall* call, GenTreePtr* ppArg) GenTreeFieldList* fieldList = new (comp, GT_FIELD_LIST) GenTreeFieldList(argLo, 0, TYP_INT, nullptr); // Only the first fieldList node (GTF_FIELD_LIST_HEAD) is in the instruction sequence. (void)new (comp, GT_FIELD_LIST) GenTreeFieldList(argHi, 4, TYP_INT, fieldList); - putArg = NewPutArg(call, fieldList, info, type); + GenTreePtr putArg = NewPutArg(call, fieldList, info, type); BlockRange().InsertBefore(arg, putArg); BlockRange().Remove(arg); @@ -1303,8 +1301,8 @@ void Lowering::LowerArg(GenTreeCall* call, GenTreePtr* ppArg) GenTreeFieldList* fieldList = new (comp, GT_FIELD_LIST) GenTreeFieldList(argLo, 0, TYP_INT, nullptr); // Only the first fieldList node (GTF_FIELD_LIST_HEAD) is in the instruction sequence. (void)new (comp, GT_FIELD_LIST) GenTreeFieldList(argHi, 4, TYP_INT, fieldList); - putArg = NewPutArg(call, fieldList, info, type); - putArg->gtRegNum = info->regNum; + GenTreePtr putArg = NewPutArg(call, fieldList, info, type); + putArg->gtRegNum = info->regNum; // We can't call ReplaceArgWithPutArgOrCopy here because it presumes that we are keeping the original arg. BlockRange().InsertBefore(arg, fieldList, putArg); @@ -1352,7 +1350,7 @@ void Lowering::LowerArg(GenTreeCall* call, GenTreePtr* ppArg) } #endif // _TARGET_ARMARCH_ - putArg = NewPutArg(call, arg, info, type); + GenTreePtr putArg = NewPutArg(call, arg, info, type); // In the case of register passable struct (in one or two registers) // the NewPutArg returns a new node (GT_PUTARG_REG or a GT_FIELD_LIST with two GT_PUTARG_REGs.) @@ -1389,21 +1387,17 @@ void Lowering::LowerArgsForCall(GenTreeCall* call) } // helper that create a node representing a relocatable physical address computation -// (optionally specifying the register to place it in) -GenTree* Lowering::AddrGen(ssize_t addr, regNumber reg) +GenTree* Lowering::AddrGen(ssize_t addr) { // this should end up in codegen as : instGen_Set_Reg_To_Imm(EA_HANDLE_CNS_RELOC, reg, addr) GenTree* result = comp->gtNewIconHandleNode(addr, GTF_ICON_FTN_ADDR); - - result->gtRegNum = reg; - return result; } // variant that takes a void* -GenTree* Lowering::AddrGen(void* addr, regNumber reg) +GenTree* Lowering::AddrGen(void* addr) { - return AddrGen((ssize_t)addr, reg); + return AddrGen((ssize_t)addr); } // do lowering steps for a call diff --git a/src/coreclr/src/jit/lower.h b/src/coreclr/src/jit/lower.h index fd0cb20e2a5..81683b98a7d 100644 --- a/src/coreclr/src/jit/lower.h +++ b/src/coreclr/src/jit/lower.h @@ -166,8 +166,8 @@ private: PopFrame }; GenTree* CreateFrameLinkUpdate(FrameLinkAction); - GenTree* AddrGen(ssize_t addr, regNumber reg = REG_NA); - GenTree* AddrGen(void* addr, regNumber reg = REG_NA); + GenTree* AddrGen(ssize_t addr); + GenTree* AddrGen(void* addr); GenTree* Ind(GenTree* tree) { @@ -282,12 +282,6 @@ private: GenTree* LowerConstIntDivOrMod(GenTree* node); GenTree* LowerSignedDivOrMod(GenTree* node); void LowerBlockStore(GenTreeBlk* blkNode); -#ifdef _TARGET_ARM64_ - void LowerPutArgStk(GenTreePutArgStk* argNode, fgArgTabEntryPtr info); -#endif // _TARGET_ARM64_ -#ifdef _TARGET_ARM_ - void LowerPutArgStk(GenTreePutArgStk* argNode, fgArgTabEntryPtr info); -#endif // _TARGET_ARM64_ void LowerPutArgStk(GenTreePutArgStk* tree); GenTree* TryCreateAddrMode(LIR::Use&& use, bool isIndir); -- GitLab