path: root/6/asm.h
diff options
authorOri Bernstein <>2016-12-04 14:18:04 -0800
committerOri Bernstein <>2016-12-04 14:18:04 -0800
commitdc611e92af421149bc0277b199250966919fe7e7 (patch)
tree73be6d2cbd8bcc15235085650f1f883833291152 /6/asm.h
parentfbc01b056541c245dce94569d3564fd8812ec72b (diff)
Reset register numbers.
In our register allocator, we create a matrix that's got nreg*nreg bits in it. When the register numbers get big, this matrix also can get big. We can't do anything about that in giant functions, but if we have lots of smaller functions, we can clear the value before generating the code, keeping the sizes of the matrixes and bit sets in check. This speeds up builds significantly in files with thousands of functions.
Diffstat (limited to '6/asm.h')
1 files changed, 1 insertions, 0 deletions
diff --git a/6/asm.h b/6/asm.h
index 5d5349b..83b3a98 100644
--- a/6/asm.h
+++ b/6/asm.h
@@ -272,6 +272,7 @@ size_t blobsz(Blob *b);
extern size_t maxregid;
extern Loc **locmap; /* mapping from reg id => Loc * */
+void resetregs(void);
char *genlocallblstr(char *buf, size_t sz);
Type *codetype(Type *ft);
Type *closuretype(Type *ft);