Skip TEMPs with negative index.
authorRoberto Raggi <roberto.raggi@nokia.com>
Mon, 14 May 2012 15:58:33 +0000 (17:58 +0200)
committerRoberto Raggi <roberto.raggi@nokia.com>
Mon, 14 May 2012 15:58:33 +0000 (17:58 +0200)
That is, TEMP nodes with negative index are a bit special, we
use them to optimize the argument passing.

qv4codegen.cpp

index f1aea0c..15f525d 100644 (file)
@@ -70,6 +70,9 @@ struct ComputeUseDef: IR::StmtVisitor, IR::ExprVisitor
     virtual void visitRet(IR::Ret *s) { s->expr->accept(this); }
 
     virtual void visitTemp(IR::Temp *e) {
+        if (e->index < 0)
+            return;
+
         if (! _stmt->d->uses.contains(e->index))
             _stmt->d->uses.append(e->index);
     }
@@ -88,8 +91,10 @@ struct ComputeUseDef: IR::StmtVisitor, IR::ExprVisitor
 
     virtual void visitMove(IR::Move *s) {
         if (IR::Temp *t = s->target->asTemp()) {
-            if (! _stmt->d->defs.contains(t->index))
-                _stmt->d->defs.append(t->index);
+            if (t->index >= 0) {
+                if (! _stmt->d->defs.contains(t->index))
+                    _stmt->d->defs.append(t->index);
+            }
         } else {
             s->target->accept(this);
         }