summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIlia Mirkin <[email protected]>2015-12-02 20:10:54 -0500
committerEmil Velikov <[email protected]>2015-12-04 16:36:44 +0000
commit7f6e9c5f59cd424b3bcdd3e8edd9600e3097c927 (patch)
tree86a3f679f0ec7913ef9836b72242fac0591e139b
parent0828391a3466b382814c03fd4ea70428d3a6800c (diff)
nv50/ir: the mad source might not have a defining instruction
For example if it's $r63 (aka 0), there won't be a definition. Signed-off-by: Ilia Mirkin <[email protected]> Cc: "11.0 11.1" <[email protected]> (cherry picked from commit 11fcf46590129abfa2ca2117a320e8a8052761e4)
-rw-r--r--src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
index 9c42e4a7e01..0f3caa8f07e 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
@@ -2660,7 +2660,7 @@ NV50PostRaConstantFolding::visit(BasicBlock *bb)
break;
def = i->getSrc(1)->getInsn();
- if (def->op == OP_MOV && def->src(0).getFile() == FILE_IMMEDIATE) {
+ if (def && def->op == OP_MOV && def->src(0).getFile() == FILE_IMMEDIATE) {
vtmp = i->getSrc(1);
i->setSrc(1, def->getSrc(0));