]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
introduce another vinstr temp
authorWolfgang Bumiller <wry.git@bumiller.com>
Sun, 15 Sep 2019 08:06:53 +0000 (10:06 +0200)
committerWolfgang Bumiller <wry.git@bumiller.com>
Sun, 15 Sep 2019 08:12:40 +0000 (10:12 +0200)
Some vinstrs are currently broken when using peephole
optimization as they appear as writing to a temporary ssa
output before being stored into their real destination,
causing the store to be optimized out, but the generated
code relies on having the destination as another temporary
value available.

Let's just add a 2nd temp to be used in those cases.

Signed-off-by: Wolfgang Bumiller <wry.git@bumiller.com>
ir.h

diff --git a/ir.h b/ir.h
index 42f6ce578ea958bd5e4cf409da8561eef2fc91b5..c81d1a24032454972fcfddbb5965992547cb6f4c 100644 (file)
--- a/ir.h
+++ b/ir.h
@@ -249,7 +249,7 @@ ir_block*       ir_function_create_block(lex_ctx_t ctx, ir_function*, const char
 
 /* builder */
 #define IR_HT_SIZE          1024
-#define IR_MAX_VINSTR_TEMPS 1
+#define IR_MAX_VINSTR_TEMPS 2
 
 struct ir_builder {
     ir_builder(const std::string& modulename);