diff options
author | Pat Gavlin <pagavlin@microsoft.com> | 2017-02-24 11:19:27 -0800 |
---|---|---|
committer | Pat Gavlin <pagavlin@microsoft.com> | 2017-02-25 09:55:03 -0800 |
commit | 350020d9b6a2bda08cf2e416d959c1801a717734 (patch) | |
tree | 276a6fe1b5dbfc88c196b25bd95b2da2bad59f4f /src/jit/gtlist.h | |
parent | 3392356945aabd5a3ebac5317ff4a0e0361dc9ad (diff) | |
download | coreclr-350020d9b6a2bda08cf2e416d959c1801a717734.tar.gz coreclr-350020d9b6a2bda08cf2e416d959c1801a717734.tar.bz2 coreclr-350020d9b6a2bda08cf2e416d959c1801a717734.zip |
Refactor isContained().
This changes isContained to terminate early if it is not possible for the node in question
to ever be contained. There are many nodes that are statically non-containable: any node
that is not a value may not be contained along with a small number of value nodes. To avoid
the need for a `switch` to identify the latter, their node kinds have been marked with a
new flag, `GTK_NOCONTAIN`. The checks for identifying non-containable nodes are encapsulated
withing a new function, `canBeContained`.
Diffstat (limited to 'src/jit/gtlist.h')
-rw-r--r-- | src/jit/gtlist.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/jit/gtlist.h b/src/jit/gtlist.h index 2d9255b6ce..826eaf1207 100644 --- a/src/jit/gtlist.h +++ b/src/jit/gtlist.h @@ -46,7 +46,7 @@ GTNODE(CNS_STR , "sconst" ,GenTreeStrCon ,0,GTK_LEAF|GTK_CON //----------------------------------------------------------------------------- GTNODE(NOT , "~" ,GenTreeOp ,0,GTK_UNOP) -GTNODE(NOP , "nop" ,GenTree ,0,GTK_UNOP) +GTNODE(NOP , "nop" ,GenTree ,0,GTK_UNOP|GTK_NOCONTAIN) GTNODE(NEG , "unary -" ,GenTreeOp ,0,GTK_UNOP) GTNODE(COPY , "copy" ,GenTreeCopyOrReload,0,GTK_UNOP) // Copies a variable from its current location to a register that satisfies // code generation constraints. The child is the actual lclVar node. @@ -65,8 +65,8 @@ GTNODE(CMPXCHG , "cmpxchg" ,GenTreeCmpXchg ,0,GTK_SPECIAL) GTNODE(MEMORYBARRIER , "memoryBarrier",GenTree ,0,GTK_LEAF|GTK_NOVALUE) GTNODE(CAST , "cast" ,GenTreeCast ,0,GTK_UNOP|GTK_EXOP) // conversion to another type -GTNODE(CKFINITE , "ckfinite" ,GenTreeOp ,0,GTK_UNOP) // Check for NaN -GTNODE(LCLHEAP , "lclHeap" ,GenTreeOp ,0,GTK_UNOP) // alloca() +GTNODE(CKFINITE , "ckfinite" ,GenTreeOp ,0,GTK_UNOP|GTK_NOCONTAIN) // Check for NaN +GTNODE(LCLHEAP , "lclHeap" ,GenTreeOp ,0,GTK_UNOP|GTK_NOCONTAIN) // alloca() GTNODE(JMP , "jump" ,GenTreeVal ,0,GTK_LEAF|GTK_NOVALUE) // Jump to another function GTNODE(ADDR , "addr" ,GenTreeOp ,0,GTK_UNOP) // address of @@ -226,7 +226,7 @@ GTNODE(FIELD , "field" ,GenTreeField ,0,GTK_SPECIAL) GTNODE(ARR_ELEM , "arrMD&" ,GenTreeArrElem ,0,GTK_SPECIAL) // Multi-dimensional array-element address GTNODE(ARR_INDEX , "arrMDIdx" ,GenTreeArrIndex ,0,GTK_BINOP|GTK_EXOP) // Effective, bounds-checked index for one dimension of a multi-dimensional array element GTNODE(ARR_OFFSET , "arrMDOffs" ,GenTreeArrOffs ,0,GTK_SPECIAL) // Flattened offset of multi-dimensional array element -GTNODE(CALL , "call()" ,GenTreeCall ,0,GTK_SPECIAL) +GTNODE(CALL , "call()" ,GenTreeCall ,0,GTK_SPECIAL|GTK_NOCONTAIN) //----------------------------------------------------------------------------- // Statement operator nodes: @@ -261,7 +261,7 @@ GTNODE(PHI_ARG , "phiArg" ,GenTreePhiArg ,0,GTK_LEAF|GTK_LOC //----------------------------------------------------------------------------- #ifndef LEGACY_BACKEND -GTNODE(JMPTABLE , "jumpTable" ,GenTreeJumpTable ,0, GTK_LEAF) // Generates the jump table for switches +GTNODE(JMPTABLE , "jumpTable" ,GenTreeJumpTable ,0, GTK_LEAF|GTK_NOCONTAIN) // Generates the jump table for switches #endif GTNODE(SWITCH_TABLE , "tableSwitch" ,GenTreeOp ,0, GTK_BINOP|GTK_NOVALUE) // Jump Table based switch construct |