You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cmd/compile: change phi location to be optimistic at backedges
This is:
(1) a simple trick that cuts the number of phi-nodes
(temporarily) inserted into the ssa representation by a factor
of 10, and can cut the user time to compile tricky inputs like
gogo/protobuf tests from 13 user minutes to 9.5, and memory
allocation from 3.4GB to 2.4GB.
(2) a fix to sparse lookup, that does not rely on
an assumption proven false by at least one pathological
input "etldlen".
These two changes fix unrelated compiler performance bugs,
both necessary to obtain good performance compiling etldlen.
Without them it takes 20 minutes or longer, with them it
completes in 2 minutes, without a gigantic memory footprint.
Updates #16407
Change-Id: Iaa8aaa8c706858b3d49de1c4865a7fd79e6f4ff7
Reviewed-on: https://go-review.googlesource.com/23136
Reviewed-by: Keith Randall <[email protected]>
Run-TryBot: David Chase <[email protected]>
TryBot-Result: Gobot Gobot <[email protected]>
// A sparseTreeMapEntry contains the data stored in a binary search
80
80
// data structure indexed by (dominator tree walk) entry and exit numbers.
81
81
// Each entry is added twice, once keyed by entry-1/entry/entry+1 and
82
-
// once keyed by exit+1/exit/exit-1. (there are three choices of paired indices, not 9, and they properly nest)
82
+
// once keyed by exit+1/exit/exit-1.
83
+
//
84
+
// Within a sparse tree, the two entries added bracket all their descendant
85
+
// entries within the tree; the first insertion is keyed by entry number,
86
+
// which comes before all the entry and exit numbers of descendants, and
87
+
// the second insertion is keyed by exit number, which comes after all the
88
+
// entry and exit numbers of the descendants.
83
89
typesparseTreeMapEntrystruct {
84
-
index*SparseTreeNode
85
-
block*Block// TODO: store this in a separate index.
86
-
datainterface{}
90
+
index*SparseTreeNode// references the entry and exit numbers for a block in the sparse tree
91
+
block*Block// TODO: store this in a separate index.
92
+
datainterface{}
93
+
sparseParent*sparseTreeMapEntry// references the nearest ancestor of this block in the sparse tree.
94
+
adjustint32// at what adjustment was this node entered into the sparse tree? The same block may be entered more than once, but at different adjustments.
87
95
}
88
96
89
97
// Insert creates a definition within b with data x.
0 commit comments