nv50/ir/opt: Fix for function calls.
authorFrancisco Jerez <currojerez@riseup.net>
Wed, 21 Mar 2012 22:53:01 +0000 (23:53 +0100)
committerChristoph Bumiller <e0425955@student.tuwien.ac.at>
Sat, 14 Apr 2012 19:54:01 +0000 (21:54 +0200)
src/gallium/drivers/nv50/codegen/nv50_ir_peephole.cpp

index 1e5a1e5..021ee1f 100644 (file)
@@ -246,7 +246,7 @@ ConstantFolding::visit(BasicBlock *bb)
 
    for (i = bb->getEntry(); i; i = next) {
       next = i->next;
-      if (i->op == OP_MOV) // continue early, MOV appears frequently
+      if (i->op == OP_MOV || i->op == OP_CALL)
          continue;
 
       ImmediateValue src0, src1;
@@ -2015,7 +2015,8 @@ GlobalCSE::visit(BasicBlock *bb)
       for (s = 1; phi->srcExists(s); ++s) {
          if (phi->getSrc(s)->refCount() > 1)
             break;
-         if (!phi->getSrc(s)->getInsn()->isResultEqual(ik))
+         if (!phi->getSrc(s)->getInsn() ||
+             !phi->getSrc(s)->getInsn()->isResultEqual(ik))
             break;
       }
       if (!phi->srcExists(s)) {