summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2014-03-17 10:39:43 -0700
committerMatt Turner <mattst88@gmail.com>2014-06-01 13:29:24 -0700
commitb1dcdcde2e323f960833f5c7da65d5c2c20113c9 (patch)
tree6852fd268a2aa5ad096322a9f624879bc6293bd2 /src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp
parent27e12a8ea933e2f978e0ce9286422e6025c7377d (diff)
downloadexternal_mesa3d-b1dcdcde2e323f960833f5c7da65d5c2c20113c9.zip
external_mesa3d-b1dcdcde2e323f960833f5c7da65d5c2c20113c9.tar.gz
external_mesa3d-b1dcdcde2e323f960833f5c7da65d5c2c20113c9.tar.bz2
i965/fs: Loop from 0 to inst->sources, not 0 to 3.
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz> Reviewed-by: Tapani Pälli <tapani.palli@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp')
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp b/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp
index 069b60f..a1aff21 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp
@@ -353,7 +353,7 @@ fs_visitor::try_constant_propagate(fs_inst *inst, acp_entry *entry)
if (entry->src.file != IMM)
return false;
- for (int i = 2; i >= 0; i--) {
+ for (int i = inst->sources - 1; i >= 0; i--) {
if (inst->src[i].file != entry->dst.file ||
inst->src[i].reg != entry->dst.reg ||
inst->src[i].reg_offset != entry->dst.reg_offset ||
@@ -492,7 +492,7 @@ fs_visitor::opt_copy_propagate_local(void *copy_prop_ctx, bblock_t *block,
inst = (fs_inst *)inst->next) {
/* Try propagating into this instruction. */
- for (int i = 0; i < 3; i++) {
+ for (int i = 0; i < inst->sources; i++) {
if (inst->src[i].file != GRF)
continue;