nv50/ir/opt: don't copy-propagate cond MOVs or MOVs to other reg files
authorChristoph Bumiller <e0425955@student.tuwien.ac.at>
Thu, 22 Mar 2012 10:51:52 +0000 (11:51 +0100)
committerChristoph Bumiller <e0425955@student.tuwien.ac.at>
Sat, 14 Apr 2012 19:54:02 +0000 (21:54 +0200)
We've never encountered the latter on nvc0, but on nv50 we have moves
between GPRs and address regs.

src/gallium/drivers/nv50/codegen/nv50_ir_peephole.cpp

index 5f97443..35ddca3 100644 (file)
@@ -97,6 +97,10 @@ CopyPropagation::visit(BasicBlock *bb)
       next = mov->next;
       if (mov->op != OP_MOV || mov->fixed || !mov->getSrc(0)->asLValue())
          continue;
+      if (mov->getPredicate())
+         continue;
+      if (mov->def(0).getFile() != mov->src(0).getFile())
+         continue;
       si = mov->getSrc(0)->getInsn();
       if (mov->getDef(0)->reg.data.id < 0 && si && si->op != OP_PHI) {
          // propagate