r600g/sb: fix constant propagation in gvn pass
authorVadim Girlin <vadimgirlin@gmail.com>
Fri, 3 May 2013 09:01:31 +0000 (13:01 +0400)
committerVadim Girlin <vadimgirlin@gmail.com>
Fri, 3 May 2013 12:53:42 +0000 (16:53 +0400)
Fixes the bug that prevented propagation of literals in some cases.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
src/gallium/drivers/r600/sb/sb_gvn.cpp

index 6798917b189727c5b525c110d3d791b3d3737445..fe4f884e21f1ecc35a88592554c332900370d046 100644 (file)
@@ -159,7 +159,8 @@ void gvn::process_alu_src_constants(node &n, value* &v) {
 
        rp_kcache_tracker kc(sh);
 
-       kc.try_reserve(v->gvn_source->select);
+       if (v->gvn_source->is_kcache())
+               kc.try_reserve(v->gvn_source->select);
 
        // don't propagate 3rd constant to the trans-only instruction
        if (!n.is_alu_packed()) {