From d72590032f4a73f824c425fbe926d4b0c4ea13e1 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Wed, 10 Jan 2018 04:25:20 +0000 Subject: [PATCH] r600/sb: handle LDS operations in folding. Don't try and fold LDS using expressions. Acked-By: Roland Scheidegger Signed-off-by: Dave Airlie --- src/gallium/drivers/r600/sb/sb_expr.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/gallium/drivers/r600/sb/sb_expr.cpp b/src/gallium/drivers/r600/sb/sb_expr.cpp index 7a5d62c8e87..7d43ef1d1d5 100644 --- a/src/gallium/drivers/r600/sb/sb_expr.cpp +++ b/src/gallium/drivers/r600/sb/sb_expr.cpp @@ -74,6 +74,8 @@ bool expr_handler::equal(value *l, value *r) { assert(l != r); + if (l->is_lds_access() || r->is_lds_access()) + return false; if (l->gvalue() == r->gvalue()) return true; @@ -383,8 +385,14 @@ bool expr_handler::fold_alu_op1(alu_node& n) { if (n.src.empty()) return false; + /* don't fold LDS instructions */ + if (n.bc.op_ptr->flags & AF_LDS) + return false; + value* v0 = n.src[0]->gvalue(); + if (v0->is_lds_oq() || v0->is_lds_access()) + return false; assert(v0 && n.dst[0]); if (!v0->is_const()) { @@ -942,6 +950,9 @@ bool expr_handler::fold_alu_op3(alu_node& n) { value* v1 = n.src[1]->gvalue(); value* v2 = n.src[2]->gvalue(); + /* LDS instructions look like op3 with no dst - don't fold. */ + if (!n.dst[0]) + return false; assert(v0 && v1 && v2 && n.dst[0]); bool isc0 = v0->is_const(); -- 2.30.2