diff options
author | Marek Olšák <maraeo@gmail.com> | 2010-12-08 04:27:58 +0100 |
---|---|---|
committer | Marek Olšák <maraeo@gmail.com> | 2010-12-08 04:39:51 +0100 |
commit | c4f9e55d61a75751a202f8028f64893c4425f541 (patch) | |
tree | 8a0157a6687b9ca285ba73f1825e4cefbc671a91 /src/mesa/drivers/dri/r300/compiler/radeon_remove_constants.c | |
parent | 2ff9d4474bdf5f05852ad4963d0b597d20743678 (diff) |
r300/compiler: remove at least unused immediates if externals cannot be removed
Diffstat (limited to 'src/mesa/drivers/dri/r300/compiler/radeon_remove_constants.c')
-rw-r--r-- | src/mesa/drivers/dri/r300/compiler/radeon_remove_constants.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_remove_constants.c b/src/mesa/drivers/dri/r300/compiler/radeon_remove_constants.c index 5f67f536f6..7d76585a59 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_remove_constants.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_remove_constants.c @@ -87,8 +87,9 @@ void rc_remove_unused_constants(struct radeon_compiler *c, void *user) rc_for_all_reads_src(inst, mark_used, &d); } - /* Pass 2: If there is relative addressing, mark all externals as used. */ - if (has_rel_addr) { + /* Pass 2: If there is relative addressing or dead constant elimination + * is disabled, mark all externals as used. */ + if (has_rel_addr || !c->remove_unused_constants) { for (unsigned i = 0; i < c->Program.Constants.Count; i++) if (constants[i].Type == RC_CONSTANT_EXTERNAL) const_used[i] = 1; @@ -119,7 +120,7 @@ void rc_remove_unused_constants(struct radeon_compiler *c, void *user) /* is_identity ==> new_count == old_count * !is_identity ==> new_count < old_count */ assert( is_identity || new_count < c->Program.Constants.Count); - assert(!(has_rel_addr && are_externals_remapped)); + assert(!((has_rel_addr || !c->remove_unused_constants) && are_externals_remapped)); /* Pass 4: Redirect reads of all constants to their new locations. */ if (!is_identity) { @@ -127,7 +128,6 @@ void rc_remove_unused_constants(struct radeon_compiler *c, void *user) inst != &c->Program.Instructions; inst = inst->Next) { rc_remap_registers(inst, remap_regs, inv_remap_table); } - } /* Set the new constant count. Note that new_count may be less than |