Don't try and fold LDS using expressions.
Acked-By: Roland Scheidegger <sroland@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
assert(l != r);
+ if (l->is_lds_access() || r->is_lds_access())
+ return false;
if (l->gvalue() == r->gvalue())
return true;
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()) {
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();