diff options
author | Vadim Girlin <[email protected]> | 2013-05-24 18:15:57 +0400 |
---|---|---|
committer | Vadim Girlin <[email protected]> | 2013-05-24 21:00:54 +0400 |
commit | e9aa46e66502248c4b266cb6c4a88851832982d8 (patch) | |
tree | 6ff001e19c36540d4fcfbc5ca19ec93958edf13b /src/gallium/drivers/r600/sb | |
parent | 5a68a29706002cd9f59faeb3ce18e7aed8a74201 (diff) |
r600g/sb: relax some restrictions for FETCH instructions
This allows GVN rewrite pass to propagate non-const (register)
values to FETCH source operands, helping to eliminate unnecessary
copies in some cases.
Signed-off-by: Vadim Girlin <[email protected]>
Diffstat (limited to 'src/gallium/drivers/r600/sb')
-rw-r--r-- | src/gallium/drivers/r600/sb/sb_gvn.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/gallium/drivers/r600/sb/sb_gvn.cpp b/src/gallium/drivers/r600/sb/sb_gvn.cpp index 12cdb1c0240..caea4ec6660 100644 --- a/src/gallium/drivers/r600/sb/sb_gvn.cpp +++ b/src/gallium/drivers/r600/sb/sb_gvn.cpp @@ -194,16 +194,15 @@ void gvn::process_op(node& n, bool rewrite) { process_src(v->rel, rewrite); } - if (rewrite && v->gvn_source && v->gvn_source->is_readonly() - && n.is_any_alu()) { + if (rewrite && v->gvn_source && v->gvn_source->is_readonly() && + n.is_any_alu()) { process_alu_src_constants(n, v); - } else { - if (rewrite && (n.is_fetch_op(FETCH_OP_VFETCH) || - n.is_fetch_op(FETCH_OP_SEMFETCH))) - process_src(v, false); - else - process_src(v, rewrite); - } + } else if (rewrite && v->gvn_source && v->gvn_source->is_const() && + (n.is_fetch_op(FETCH_OP_VFETCH) || + n.is_fetch_op(FETCH_OP_SEMFETCH))) + process_src(v, false); + else + process_src(v, rewrite); } } if (n.pred) |