summaryrefslogtreecommitdiff
path: root/6/asm.h
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2014-06-04 00:09:37 -0400
committerOri Bernstein <ori@eigenstate.org>2014-06-04 00:09:37 -0400
commita340b8b9e6b3645eccb5ee3e00cb92c974029c68 (patch)
tree8732a9363aa1296749673734f958c1959cb05b96 /6/asm.h
parent6007029a7fcb1184f5f3d698ed55f96fa4812ac1 (diff)
downloadmc-a340b8b9e6b3645eccb5ee3e00cb92c974029c68.tar.gz
Optimize the register allocator.
We don't need to iterate through lists to figure out which node a list is on. Store it in the node.
Diffstat (limited to '6/asm.h')
-rw-r--r--6/asm.h17
1 files changed, 9 insertions, 8 deletions
diff --git a/6/asm.h b/6/asm.h
index 9a15941..6b01e26 100644
--- a/6/asm.h
+++ b/6/asm.h
@@ -59,6 +59,7 @@ typedef enum {
struct Loc {
Loctype type; /* the type of loc */
Mode mode; /* the mode of this location */
+ void *list;
union {
char *lbl; /* for Loclbl, Loclitl */
struct { /* for Locreg */
@@ -113,7 +114,6 @@ struct Asmbb {
Bitset *liveout; /* variables live on exit from BB */
};
-
/* instruction selection state */
struct Isel {
Cfg *cfg; /* cfg built with nodes */
@@ -133,8 +133,6 @@ struct Isel {
Loc *calleesave[Nsaved];
/* register allocator state */
- Bitset *prepainted; /* locations that need to be a specific colour */
- Bitset *initial; /* initial set of locations used by this fn */
size_t *gbits; /* igraph matrix repr */
regid **gadj; /* igraph adj set repr */
@@ -142,11 +140,6 @@ struct Isel {
int *degree; /* degree of nodes */
Loc **aliasmap; /* mapping of aliases */
- Loc **selstk;
- size_t nselstk;
-
- Bitset *coalesced;
- Bitset *spilled;
Bitset *shouldspill; /* the first registers we should try to spill */
Bitset *neverspill; /* registers we should never spill */
@@ -179,6 +172,14 @@ struct Isel {
Loc **wlsimp;
size_t nwlsimp;
+
+ Loc **selstk;
+ size_t nselstk;
+
+ Bitset *coalesced;
+ Bitset *spilled;
+ Bitset *prepainted; /* locations that need to be a specific colour */
+ Bitset *initial; /* initial set of locations used by this fn */
};
/* entry points */