summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorMatt Turner <[email protected]>2014-06-24 16:31:38 -0700
committerMatt Turner <[email protected]>2014-07-01 08:55:51 -0700
commit266109736a9a69c3fdbe49fe1665a7a63c5cc122 (patch)
treeb3fa310a9a6a5b59c77af877b513f427d3135c64 /src/mesa
parentc5030ac0ac15d3c91c4352789f94281da9a9dcad (diff)
i965: Use typed foreach_in_list_safe instead of foreach_list_safe.
Acked-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs.cpp24
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp7
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_cse.cpp4
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_dead_code_eliminate.cpp4
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_register_coalesce.cpp4
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp4
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_visitor.cpp3
-rw-r--r--src/mesa/drivers/dri/i965/brw_schedule_instructions.cpp3
-rw-r--r--src/mesa/drivers/dri/i965/brw_vec4.cpp12
-rw-r--r--src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp8
-rw-r--r--src/mesa/drivers/dri/i965/intel_resolve_map.c2
11 files changed, 20 insertions, 55 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index 4be9161659d..5a3d1d3125c 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -1800,9 +1800,7 @@ fs_visitor::move_uniform_array_access_to_pull_constants()
* Note that we don't move constant-indexed accesses to arrays. No
* testing has been done of the performance impact of this choice.
*/
- foreach_list_safe(node, &this->instructions) {
- fs_inst *inst = (fs_inst *)node;
-
+ foreach_in_list_safe(fs_inst, inst, &instructions) {
for (int i = 0 ; i < inst->sources; i++) {
if (inst->src[i].file != UNIFORM || !inst->src[i].reladdr)
continue;
@@ -2079,9 +2077,7 @@ fs_visitor::compute_to_mrf()
calculate_live_intervals();
- foreach_list_safe(node, &this->instructions) {
- fs_inst *inst = (fs_inst *)node;
-
+ foreach_in_list_safe(fs_inst, inst, &instructions) {
int ip = next_ip;
next_ip++;
@@ -2251,9 +2247,7 @@ fs_visitor::remove_duplicate_mrf_writes()
memset(last_mrf_move, 0, sizeof(last_mrf_move));
- foreach_list_safe(node, &this->instructions) {
- fs_inst *inst = (fs_inst *)node;
-
+ foreach_in_list_safe(fs_inst, inst, &instructions) {
if (inst->is_control_flow()) {
memset(last_mrf_move, 0, sizeof(last_mrf_move));
}
@@ -2505,9 +2499,7 @@ fs_visitor::insert_gen4_send_dependency_workarounds()
* have a .reg_offset of 0.
*/
- foreach_list_safe(node, &this->instructions) {
- fs_inst *inst = (fs_inst *)node;
-
+ foreach_in_list_safe(fs_inst, inst, &instructions) {
if (inst->mlen != 0 && inst->dst.file == GRF) {
insert_gen4_pre_send_dependency_workarounds(inst);
insert_gen4_post_send_dependency_workarounds(inst);
@@ -2590,9 +2582,7 @@ fs_visitor::lower_load_payload()
{
bool progress = false;
- foreach_list_safe(node, &instructions) {
- fs_inst *inst = (fs_inst *)node;
-
+ foreach_in_list_safe(fs_inst, inst, &instructions) {
if (inst->opcode == SHADER_OPCODE_LOAD_PAYLOAD) {
fs_reg dst = inst->dst;
@@ -2986,9 +2976,7 @@ fs_visitor::opt_drop_redundant_mov_to_flags()
{
bool flag_mov_found[2] = {false};
- foreach_list_safe(node, &this->instructions) {
- fs_inst *inst = (fs_inst *)node;
-
+ foreach_in_list_safe(fs_inst, inst, &instructions) {
if (inst->is_control_flow()) {
memset(flag_mov_found, 0, sizeof(flag_mov_found));
} else if (inst->opcode == FS_OPCODE_MOV_DISPATCH_TO_FLAGS) {
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 7db5df403e0..72329e15ed6 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp
@@ -545,9 +545,7 @@ fs_visitor::opt_copy_propagate_local(void *copy_prop_ctx, bblock_t *block,
/* kill the destination from the ACP */
if (inst->dst.file == GRF) {
- foreach_list_safe(entry_node, &acp[inst->dst.reg % ACP_HASH_SIZE]) {
- acp_entry *entry = (acp_entry *)entry_node;
-
+ foreach_in_list_safe(acp_entry, entry, &acp[inst->dst.reg % ACP_HASH_SIZE]) {
if (inst->overwrites_reg(entry->dst)) {
entry->remove();
}
@@ -557,8 +555,7 @@ fs_visitor::opt_copy_propagate_local(void *copy_prop_ctx, bblock_t *block,
* the source, so walk across the entire table.
*/
for (int i = 0; i < ACP_HASH_SIZE; i++) {
- foreach_list_safe(entry_node, &acp[i]) {
- acp_entry *entry = (acp_entry *)entry_node;
+ foreach_in_list_safe(acp_entry, entry, &acp[i]) {
if (inst->overwrites_reg(entry->src))
entry->remove();
}
diff --git a/src/mesa/drivers/dri/i965/brw_fs_cse.cpp b/src/mesa/drivers/dri/i965/brw_fs_cse.cpp
index e4068fc7087..381c5697f10 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_cse.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_cse.cpp
@@ -264,9 +264,7 @@ fs_visitor::opt_cse_local(bblock_t *block, exec_list *aeb)
}
}
- foreach_list_safe(entry_node, aeb) {
- aeb_entry *entry = (aeb_entry *)entry_node;
-
+ foreach_in_list_safe(aeb_entry, entry, aeb) {
/* Kill all AEB entries that write a different value to or read from
* the flag register if we just wrote it.
*/
diff --git a/src/mesa/drivers/dri/i965/brw_fs_dead_code_eliminate.cpp b/src/mesa/drivers/dri/i965/brw_fs_dead_code_eliminate.cpp
index 3fefe81fa22..7b2d4aa9b72 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_dead_code_eliminate.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_dead_code_eliminate.cpp
@@ -103,9 +103,7 @@ fs_visitor::dead_code_eliminate()
ralloc_free(live);
if (progress) {
- foreach_list_safe(node, &this->instructions) {
- fs_inst *inst = (fs_inst *)node;
-
+ foreach_in_list_safe(fs_inst, inst, &instructions) {
if (inst->opcode == BRW_OPCODE_NOP) {
inst->remove();
}
diff --git a/src/mesa/drivers/dri/i965/brw_fs_register_coalesce.cpp b/src/mesa/drivers/dri/i965/brw_fs_register_coalesce.cpp
index 7b2b0d11aec..e242e4fbccd 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_register_coalesce.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_register_coalesce.cpp
@@ -272,9 +272,7 @@ fs_visitor::register_coalesce()
}
if (progress) {
- foreach_list_safe(node, &this->instructions) {
- fs_inst *inst = (fs_inst *)node;
-
+ foreach_in_list_safe(fs_inst, inst, &instructions) {
if (inst->opcode == BRW_OPCODE_NOP) {
inst->remove();
}
diff --git a/src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp b/src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp
index a048b3dc0e5..5ddd6e82e98 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp
@@ -336,9 +336,7 @@ brw_do_vector_splitting(exec_list *instructions)
visit_list_elements(&refs, instructions);
/* Trim out variables we can't split. */
- foreach_list_safe(node, &refs.variable_list) {
- variable_entry *entry = (variable_entry *)node;
-
+ foreach_in_list_safe(variable_entry, entry, &refs.variable_list) {
if (debug) {
fprintf(stderr, "vector %s@%p: whole_access %d\n",
entry->var->name, (void *) entry->var,
diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
index ce7075f7940..8de4d9d72d8 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
@@ -2510,8 +2510,7 @@ fs_visitor::emit(fs_inst *inst)
void
fs_visitor::emit(exec_list list)
{
- foreach_list_safe(node, &list) {
- fs_inst *inst = (fs_inst *)node;
+ foreach_in_list_safe(fs_inst, inst, &list) {
inst->remove();
emit(inst);
}
diff --git a/src/mesa/drivers/dri/i965/brw_schedule_instructions.cpp b/src/mesa/drivers/dri/i965/brw_schedule_instructions.cpp
index cc136a5b948..245df2a6fbf 100644
--- a/src/mesa/drivers/dri/i965/brw_schedule_instructions.cpp
+++ b/src/mesa/drivers/dri/i965/brw_schedule_instructions.cpp
@@ -1352,8 +1352,7 @@ instruction_scheduler::schedule_instructions(backend_instruction *next_block_hea
time = 0;
/* Remove non-DAG heads from the list. */
- foreach_list_safe(node, &instructions) {
- schedule_node *n = (schedule_node *)node;
+ foreach_in_list_safe(schedule_node, n, &instructions) {
if (n->parent_count != 0)
n->remove();
}
diff --git a/src/mesa/drivers/dri/i965/brw_vec4.cpp b/src/mesa/drivers/dri/i965/brw_vec4.cpp
index bcd1b3a8a79..14bcb117186 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4.cpp
@@ -392,9 +392,7 @@ vec4_visitor::dead_code_eliminate()
calculate_live_intervals();
- foreach_list_safe(node, &this->instructions) {
- vec4_instruction *inst = (vec4_instruction *)node;
-
+ foreach_in_list_safe(vec4_instruction, inst, &instructions) {
pc++;
bool inst_writes_flag = false;
@@ -755,9 +753,7 @@ vec4_visitor::move_push_constants_to_pull_constants()
/* Now actually rewrite usage of the things we've moved to pull
* constants.
*/
- foreach_list_safe(node, &this->instructions) {
- vec4_instruction *inst = (vec4_instruction *)node;
-
+ foreach_in_list_safe(vec4_instruction, inst, &instructions) {
for (int i = 0 ; i < 3; i++) {
if (inst->src[i].file != UNIFORM ||
pull_constant_loc[inst->src[i].reg] == -1)
@@ -987,9 +983,7 @@ vec4_visitor::opt_register_coalesce()
calculate_live_intervals();
- foreach_list_safe(node, &this->instructions) {
- vec4_instruction *inst = (vec4_instruction *)node;
-
+ foreach_in_list_safe(vec4_instruction, inst, &instructions) {
int ip = next_ip;
next_ip++;
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
index dea7ae4bf1d..0d04b8294e6 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
@@ -3254,9 +3254,7 @@ vec4_visitor::move_grf_array_access_to_scratch()
* we may generate a new scratch_write instruction after the one
* we're processing.
*/
- foreach_list_safe(node, &this->instructions) {
- vec4_instruction *inst = (vec4_instruction *)node;
-
+ foreach_in_list_safe(vec4_instruction, inst, &instructions) {
/* Set up the annotation tracking for new generated instructions. */
base_ir = inst->ir;
current_annotation = inst->annotation;
@@ -3340,9 +3338,7 @@ vec4_visitor::move_uniform_array_access_to_pull_constants()
* Note that we don't move constant-indexed accesses to arrays. No
* testing has been done of the performance impact of this choice.
*/
- foreach_list_safe(node, &this->instructions) {
- vec4_instruction *inst = (vec4_instruction *)node;
-
+ foreach_in_list_safe(vec4_instruction, inst, &instructions) {
for (int i = 0 ; i < 3; i++) {
if (inst->src[i].file != UNIFORM || !inst->src[i].reladdr)
continue;
diff --git a/src/mesa/drivers/dri/i965/intel_resolve_map.c b/src/mesa/drivers/dri/i965/intel_resolve_map.c
index a37afa684dd..bf6bcf257a9 100644
--- a/src/mesa/drivers/dri/i965/intel_resolve_map.c
+++ b/src/mesa/drivers/dri/i965/intel_resolve_map.c
@@ -87,7 +87,7 @@ intel_resolve_map_remove(struct intel_resolve_map *elem)
void
intel_resolve_map_clear(struct exec_list *resolve_map)
{
- foreach_list_safe(node, resolve_map) {
+ foreach_in_list_safe(struct exec_node, node, resolve_map) {
free(node);
}