summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2018-01-10 04:25:20 +0000
committerDave Airlie <[email protected]>2018-01-18 03:37:35 +0000
commitd72590032f4a73f824c425fbe926d4b0c4ea13e1 (patch)
treef55d6013842096f51f908224f9e1f957ae77296e /src/gallium/drivers
parentc314b0a27ac3f957a92863df3e5bc462432b0262 (diff)
r600/sb: handle LDS operations in folding.
Don't try and fold LDS using expressions. Acked-By: Roland Scheidegger <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/r600/sb/sb_expr.cpp11
1 files changed, 11 insertions, 0 deletions
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();