From 1e957941735fae514de658c836b8bdaf6c66bc06 Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Wed, 21 Mar 2012 23:53:01 +0100 Subject: [PATCH] nv50/ir/opt: Fix for function calls. --- src/gallium/drivers/nv50/codegen/nv50_ir_peephole.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/nv50/codegen/nv50_ir_peephole.cpp b/src/gallium/drivers/nv50/codegen/nv50_ir_peephole.cpp index 1e5a1e531d5..021ee1f22b7 100644 --- a/src/gallium/drivers/nv50/codegen/nv50_ir_peephole.cpp +++ b/src/gallium/drivers/nv50/codegen/nv50_ir_peephole.cpp @@ -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)) { -- 2.30.2