summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Danes <onemihaid@hotmail.com>2018-11-03 00:11:57 +0200
committerMike Danes <onemihaid@hotmail.com>2018-11-03 09:44:36 +0200
commit3d4b3375b5fb943f1bfddb88dc8baa840bd32420 (patch)
tree9a0a1966261838e3036ccd27f95c280fb9e91424
parentd10a43375ef9086034cc64dce114b70f801321e8 (diff)
downloadcoreclr-3d4b3375b5fb943f1bfddb88dc8baa840bd32420.tar.gz
coreclr-3d4b3375b5fb943f1bfddb88dc8baa840bd32420.tar.bz2
coreclr-3d4b3375b5fb943f1bfddb88dc8baa840bd32420.zip
Delete GenTreeLabel
This is only used to hold a pointer to a BasicBlock for GenTreeBoundsChk and GenTreeIndexAddr. This doesn't serve any purpose and it does not behave like a real operand (e.g. it's not included in the linear order).
-rw-r--r--src/jit/codegen.h2
-rw-r--r--src/jit/codegenarmarch.cpp3
-rw-r--r--src/jit/codegencommon.cpp5
-rw-r--r--src/jit/codegenxarch.cpp3
-rw-r--r--src/jit/compiler.cpp9
-rw-r--r--src/jit/compiler.h2
-rw-r--r--src/jit/compiler.hpp8
-rw-r--r--src/jit/gentree.cpp19
-rw-r--r--src/jit/gentree.h20
-rw-r--r--src/jit/gtlist.h2
-rw-r--r--src/jit/gtstructs.h1
-rw-r--r--src/jit/lower.cpp6
-rw-r--r--src/jit/morph.cpp4
13 files changed, 12 insertions, 72 deletions
diff --git a/src/jit/codegen.h b/src/jit/codegen.h
index fa12670614..51ac84d929 100644
--- a/src/jit/codegen.h
+++ b/src/jit/codegen.h
@@ -250,7 +250,7 @@ protected:
void genExitCode(BasicBlock* block);
- void genJumpToThrowHlpBlk(emitJumpKind jumpKind, SpecialCodeKind codeKind, GenTree* failBlk = nullptr);
+ void genJumpToThrowHlpBlk(emitJumpKind jumpKind, SpecialCodeKind codeKind, BasicBlock* failBlk = nullptr);
void genCheckOverflow(GenTree* tree);
diff --git a/src/jit/codegenarmarch.cpp b/src/jit/codegenarmarch.cpp
index bba8c6a1de..a4fe4f7ffd 100644
--- a/src/jit/codegenarmarch.cpp
+++ b/src/jit/codegenarmarch.cpp
@@ -397,8 +397,7 @@ void CodeGen::genCodeForTreeNode(GenTree* treeNode)
break;
case GT_LABEL:
- genPendingCallLabel = genCreateTempLabel();
- treeNode->gtLabel.gtLabBB = genPendingCallLabel;
+ genPendingCallLabel = genCreateTempLabel();
emit->emitIns_R_L(INS_adr, EA_PTRSIZE, genPendingCallLabel, targetReg);
break;
diff --git a/src/jit/codegencommon.cpp b/src/jit/codegencommon.cpp
index 0d4cd7da5f..d81436b793 100644
--- a/src/jit/codegencommon.cpp
+++ b/src/jit/codegencommon.cpp
@@ -1967,7 +1967,7 @@ void CodeGen::genExitCode(BasicBlock* block)
// codeKind - the special throw-helper kind;
// failBlk - optional fail target block, if it is already known;
//
-void CodeGen::genJumpToThrowHlpBlk(emitJumpKind jumpKind, SpecialCodeKind codeKind, GenTree* failBlk)
+void CodeGen::genJumpToThrowHlpBlk(emitJumpKind jumpKind, SpecialCodeKind codeKind, BasicBlock* failBlk)
{
bool useThrowHlpBlk = compiler->fgUseThrowHelperBlocks();
#if defined(UNIX_X86_ABI) && FEATURE_EH_FUNCLETS
@@ -1985,8 +1985,7 @@ void CodeGen::genJumpToThrowHlpBlk(emitJumpKind jumpKind, SpecialCodeKind codeKi
if (failBlk != nullptr)
{
// We already know which block to jump to. Use that.
- assert(failBlk->gtOper == GT_LABEL);
- excpRaisingBlock = failBlk->gtLabel.gtLabBB;
+ excpRaisingBlock = failBlk;
#ifdef DEBUG
Compiler::AddCodeDsc* add =
diff --git a/src/jit/codegenxarch.cpp b/src/jit/codegenxarch.cpp
index 54ff6dcd7e..1fe286f893 100644
--- a/src/jit/codegenxarch.cpp
+++ b/src/jit/codegenxarch.cpp
@@ -1882,8 +1882,7 @@ void CodeGen::genCodeForTreeNode(GenTree* treeNode)
break;
case GT_LABEL:
- genPendingCallLabel = genCreateTempLabel();
- treeNode->gtLabel.gtLabBB = genPendingCallLabel;
+ genPendingCallLabel = genCreateTempLabel();
emit->emitIns_R_L(INS_lea, EA_PTR_DSP_RELOC, genPendingCallLabel, treeNode->gtRegNum);
break;
diff --git a/src/jit/compiler.cpp b/src/jit/compiler.cpp
index f906799ff3..2ee6f1edc7 100644
--- a/src/jit/compiler.cpp
+++ b/src/jit/compiler.cpp
@@ -10236,15 +10236,6 @@ int cLeafIR(Compiler* comp, GenTree* tree)
break;
case GT_LABEL:
-
- if (tree->gtLabel.gtLabBB)
- {
- chars += printf(FMT_BB, tree->gtLabel.gtLabBB->bbNum);
- }
- else
- {
- chars += printf("BB?");
- }
break;
case GT_IL_OFFSET:
diff --git a/src/jit/compiler.h b/src/jit/compiler.h
index aff7ceaed2..c0c8625224 100644
--- a/src/jit/compiler.h
+++ b/src/jit/compiler.h
@@ -2415,8 +2415,6 @@ public:
GenTreeLclFld* gtNewLclFldNode(unsigned lnum, var_types type, unsigned offset);
GenTree* gtNewInlineCandidateReturnExpr(GenTree* inlineCandidate, var_types type);
- GenTree* gtNewCodeRef(BasicBlock* block);
-
GenTree* gtNewFieldRef(var_types typ, CORINFO_FIELD_HANDLE fldHnd, GenTree* obj = nullptr, DWORD offset = 0);
GenTree* gtNewIndexRef(var_types typ, GenTree* arrayOp, GenTree* indexOp);
diff --git a/src/jit/compiler.hpp b/src/jit/compiler.hpp
index ffe8fd88e4..fe2e20f804 100644
--- a/src/jit/compiler.hpp
+++ b/src/jit/compiler.hpp
@@ -1175,14 +1175,6 @@ inline GenTree* Compiler::gtNewRuntimeLookup(CORINFO_GENERIC_HANDLE hnd, CorInfo
return node;
}
-/*****************************************************************************/
-
-inline GenTree* Compiler::gtNewCodeRef(BasicBlock* block)
-{
- GenTree* node = new (this, GT_LABEL) GenTreeLabel(block);
- return node;
-}
-
/*****************************************************************************
*
* A little helper to create a data member reference node.
diff --git a/src/jit/gentree.cpp b/src/jit/gentree.cpp
index 5846187268..4169d80498 100644
--- a/src/jit/gentree.cpp
+++ b/src/jit/gentree.cpp
@@ -340,7 +340,6 @@ void GenTree::InitNodeSize()
static_assert_no_msg(sizeof(GenTreeStmt) <= TREE_NODE_SZ_LARGE); // *** large node
static_assert_no_msg(sizeof(GenTreeClsVar) <= TREE_NODE_SZ_SMALL);
static_assert_no_msg(sizeof(GenTreeArgPlace) <= TREE_NODE_SZ_SMALL);
- static_assert_no_msg(sizeof(GenTreeLabel) <= TREE_NODE_SZ_SMALL);
static_assert_no_msg(sizeof(GenTreePhiArg) <= TREE_NODE_SZ_SMALL);
static_assert_no_msg(sizeof(GenTreeAllocObj) <= TREE_NODE_SZ_LARGE); // *** large node
#ifndef FEATURE_PUT_STRUCT_ARG_STK
@@ -4546,10 +4545,6 @@ GenTree** GenTree::gtGetChildPointer(GenTree* parent) const
{
return &(parent->gtBoundsChk.gtArrLen);
}
- if (this == parent->gtBoundsChk.gtIndRngFailBB)
- {
- return &(parent->gtBoundsChk.gtIndRngFailBB);
- }
break;
case GT_ARR_ELEM:
@@ -6926,6 +6921,7 @@ GenTree* Compiler::gtCloneExpr(
case GT_CATCH_ARG:
case GT_NO_OP:
+ case GT_LABEL:
copy = new (this, oper) GenTree(oper, tree->gtType);
goto DONE;
@@ -6936,10 +6932,6 @@ GenTree* Compiler::gtCloneExpr(
copy = new (this, oper) GenTreeVal(oper, tree->gtType, tree->gtVal.gtVal1);
goto DONE;
- case GT_LABEL:
- copy = new (this, oper) GenTreeLabel(tree->gtLabel.gtLabBB);
- goto DONE;
-
default:
NO_WAY("Cloning of node not supported");
goto DONE;
@@ -10236,15 +10228,6 @@ void Compiler::gtDispLeaf(GenTree* tree, IndentStack* indentStack)
break;
case GT_LABEL:
- if (tree->gtLabel.gtLabBB)
- {
- printf(" dst=" FMT_BB, tree->gtLabel.gtLabBB->bbNum);
- }
- else
- {
- printf(" dst=<null>");
- }
-
break;
case GT_FTN_ADDR:
diff --git a/src/jit/gentree.h b/src/jit/gentree.h
index a086e32d2b..5c8ba8028d 100644
--- a/src/jit/gentree.h
+++ b/src/jit/gentree.h
@@ -4211,7 +4211,7 @@ struct GenTreeIndexAddr : public GenTreeOp
CORINFO_CLASS_HANDLE gtStructElemClass; // If the element type is a struct, this is the struct type.
- GenTree* gtIndRngFailBB; // Label to jump to for array-index-out-of-range
+ BasicBlock* gtIndRngFailBB; // Basic block to jump to for array-index-out-of-range
var_types gtElemType; // The element type of the array.
unsigned gtElemSize; // size of elements in the array
@@ -4297,7 +4297,7 @@ struct GenTreeBoundsChk : public GenTree
GenTree* gtIndex; // The index expression.
GenTree* gtArrLen; // An expression for the length of the array being indexed.
- GenTree* gtIndRngFailBB; // Label to jump to for array-index-out-of-range
+ BasicBlock* gtIndRngFailBB; // Basic block to jump to for array-index-out-of-range
SpecialCodeKind gtThrowKind; // Kind of throw block to branch to on failure
GenTreeBoundsChk(genTreeOps oper, var_types type, GenTree* index, GenTree* arrLen, SpecialCodeKind kind)
@@ -5020,22 +5020,6 @@ struct GenTreeArgPlace : public GenTree
#endif
};
-/* gtLabel -- code label target (GT_LABEL) */
-
-struct GenTreeLabel : public GenTree
-{
- BasicBlock* gtLabBB;
-
- GenTreeLabel(BasicBlock* bb) : GenTree(GT_LABEL, TYP_VOID), gtLabBB(bb)
- {
- }
-#if DEBUGGABLE_GENTREE
- GenTreeLabel() : GenTree()
- {
- }
-#endif
-};
-
/* gtPhiArg -- phi node rhs argument, var = phi(phiarg, phiarg, phiarg...); GT_PHI_ARG */
struct GenTreePhiArg : public GenTreeLclVarCommon
{
diff --git a/src/jit/gtlist.h b/src/jit/gtlist.h
index 9fd12753fb..663428c5aa 100644
--- a/src/jit/gtlist.h
+++ b/src/jit/gtlist.h
@@ -27,7 +27,7 @@ GTNODE(LCL_FLD_ADDR , GenTreeLclFld ,0,GTK_LEAF) // addre
GTNODE(STORE_LCL_VAR , GenTreeLclVar ,0,GTK_UNOP|GTK_LOCAL|GTK_NOVALUE) // store to local variable
GTNODE(STORE_LCL_FLD , GenTreeLclFld ,0,GTK_UNOP|GTK_LOCAL|GTK_NOVALUE) // store to field in a non-primitive variable
GTNODE(CATCH_ARG , GenTree ,0,GTK_LEAF) // Exception object in a catch block
-GTNODE(LABEL , GenTreeLabel ,0,GTK_LEAF) // Jump-target
+GTNODE(LABEL , GenTree ,0,GTK_LEAF) // Jump-target
GTNODE(FTN_ADDR , GenTreeFptrVal ,0,GTK_LEAF) // Address of a function
GTNODE(RET_EXPR , GenTreeRetExpr ,0,GTK_LEAF) // Place holder for the return expression from an inline candidate
diff --git a/src/jit/gtstructs.h b/src/jit/gtstructs.h
index e6b0442369..3b3036db7e 100644
--- a/src/jit/gtstructs.h
+++ b/src/jit/gtstructs.h
@@ -94,7 +94,6 @@ GTSTRUCT_2(Stmt , GT_STMT, GT_IL_OFFSET)
GTSTRUCT_2(CopyOrReload, GT_COPY, GT_RELOAD)
GTSTRUCT_2(ClsVar , GT_CLS_VAR, GT_CLS_VAR_ADDR)
GTSTRUCT_1(ArgPlace , GT_ARGPLACE)
-GTSTRUCT_1(Label , GT_LABEL)
GTSTRUCT_1(CmpXchg , GT_CMPXCHG)
GTSTRUCT_1(AddrMode , GT_LEA)
GTSTRUCT_N(Blk , GT_BLK, GT_STORE_BLK, GT_OBJ, GT_STORE_OBJ, GT_DYN_BLK, GT_STORE_DYN_BLK)
diff --git a/src/jit/lower.cpp b/src/jit/lower.cpp
index 47ef1d0460..0016dc2530 100644
--- a/src/jit/lower.cpp
+++ b/src/jit/lower.cpp
@@ -3658,11 +3658,7 @@ void Lowering::InsertPInvokeCallProlog(GenTreeCall* call)
new (comp, GT_STORE_LCL_FLD) GenTreeLclFld(GT_STORE_LCL_FLD, TYP_I_IMPL, comp->lvaInlinedPInvokeFrameVar,
callFrameInfo.offsetOfReturnAddress);
- // We don't have a real label, and inserting one is hard (even if we made a special node),
- // so for now we will just 'know' what this means in codegen.
- GenTreeLabel* labelRef = new (comp, GT_LABEL) GenTreeLabel(nullptr);
- labelRef->gtType = TYP_I_IMPL;
- storeLab->gtOp1 = labelRef;
+ storeLab->gtOp1 = new (comp, GT_LABEL) GenTree(GT_LABEL, TYP_I_IMPL);
storeLab->gtFlags |= GTF_VAR_DEF;
InsertTreeBeforeAndContainCheck(insertBefore, storeLab);
diff --git a/src/jit/morph.cpp b/src/jit/morph.cpp
index 85f50d8855..5f4b50e0cb 100644
--- a/src/jit/morph.cpp
+++ b/src/jit/morph.cpp
@@ -5447,7 +5447,7 @@ void Compiler::fgSetRngChkTarget(GenTree* tree, bool delay)
BasicBlock* const failBlock = fgSetRngChkTargetInner(boundsChk->gtThrowKind, delay);
if (failBlock != nullptr)
{
- boundsChk->gtIndRngFailBB = gtNewCodeRef(failBlock);
+ boundsChk->gtIndRngFailBB = failBlock;
}
}
else if (tree->OperIs(GT_INDEX_ADDR))
@@ -5456,7 +5456,7 @@ void Compiler::fgSetRngChkTarget(GenTree* tree, bool delay)
BasicBlock* const failBlock = fgSetRngChkTargetInner(SCK_RNGCHK_FAIL, delay);
if (failBlock != nullptr)
{
- indexAddr->gtIndRngFailBB = gtNewCodeRef(failBlock);
+ indexAddr->gtIndRngFailBB = failBlock;
}
}
else