]> de.git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
Actually generate the vector member ir_values in ir_function_finalize, since ir_build...
authorWolfgang Bumiller <blub@speed.at>
Tue, 25 Dec 2012 22:51:29 +0000 (23:51 +0100)
committerWolfgang Bumiller <blub@speed.at>
Thu, 27 Dec 2012 13:38:47 +0000 (14:38 +0100)
Conflicts:
ir.c

ir.c

diff --git a/ir.c b/ir.c
index f858bb6e9a535a63eb6233cbcac334e20af3989c..f7bc0527ce5a21dceb22790d4a063495539ace24 100644 (file)
--- a/ir.c
+++ b/ir.c
@@ -728,6 +728,8 @@ bool ir_function_pass_tailrecursion(ir_function *self)
 
 bool ir_function_finalize(ir_function *self)
 {
+    size_t i;
+
     if (self->builtin)
         return true;
 
@@ -748,6 +750,27 @@ bool ir_function_finalize(ir_function *self)
     if (!ir_function_naive_phi(self))
         return false;
 
+    for (i = 0; i < vec_size(self->locals); ++i) {
+        ir_value *v = self->locals[i];
+        if (v->vtype == TYPE_VECTOR ||
+            (v->vtype == TYPE_FIELD && v->outtype == TYPE_VECTOR))
+        {
+            ir_value_vector_member(v, 0);
+            ir_value_vector_member(v, 1);
+            ir_value_vector_member(v, 2);
+        }
+    }
+    for (i = 0; i < vec_size(self->values); ++i) {
+        ir_value *v = self->values[i];
+        if (v->vtype == TYPE_VECTOR ||
+            (v->vtype == TYPE_FIELD && v->outtype == TYPE_VECTOR))
+        {
+            ir_value_vector_member(v, 0);
+            ir_value_vector_member(v, 1);
+            ir_value_vector_member(v, 2);
+        }
+    }
+
     ir_function_enumerate(self);
 
     if (!ir_function_calculate_liferanges(self))