summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/nv50/nv50_pc_optimize.c
diff options
context:
space:
mode:
authorChristoph Bumiller <e0425955@student.tuwien.ac.at>2010-08-17 11:51:51 +0200
committerChristoph Bumiller <e0425955@student.tuwien.ac.at>2010-08-17 13:08:52 +0200
commitce1629564d1cce80b2762d266640e3181a68e848 (patch)
tree56b18f99238ad4deb78d3f0247d6db3866255826 /src/gallium/drivers/nv50/nv50_pc_optimize.c
parent62f933a6f617050a267079b27360eaae2d0e1a70 (diff)
nv50: more TGSI opcodes (SIN, SCS, ARL, RET, KILP)
Diffstat (limited to 'src/gallium/drivers/nv50/nv50_pc_optimize.c')
-rw-r--r--src/gallium/drivers/nv50/nv50_pc_optimize.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/gallium/drivers/nv50/nv50_pc_optimize.c b/src/gallium/drivers/nv50/nv50_pc_optimize.c
index b35dd72841..3e6e09a904 100644
--- a/src/gallium/drivers/nv50/nv50_pc_optimize.c
+++ b/src/gallium/drivers/nv50/nv50_pc_optimize.c
@@ -293,14 +293,15 @@ check_swap_src_0_1(struct nv_instruction *nvi)
static int
nv_pass_fold_stores(struct nv_pass *ctx, struct nv_basic_block *b)
{
- struct nv_instruction *nvi, *sti;
+ struct nv_instruction *nvi, *sti, *next;
int j;
- for (sti = b->entry; sti; sti = sti->next) {
- if (!sti->def[0] || sti->def[0]->reg.file != NV_FILE_OUT)
- continue;
+ for (sti = b->entry; sti; sti = next) {
+ next = sti->next;
/* only handling MOV to $oX here */
+ if (!sti->def[0] || sti->def[0]->reg.file != NV_FILE_OUT)
+ continue;
if (sti->opcode != NV_OP_MOV && sti->opcode != NV_OP_STA)
continue;
@@ -320,9 +321,9 @@ nv_pass_fold_stores(struct nv_pass *ctx, struct nv_basic_block *b)
continue;
nvi->def[0] = sti->def[0];
- sti->def[0] = NULL;
nvi->fixed = sti->fixed;
- sti->fixed = 0;
+
+ nv_nvi_delete(sti);
}
DESCEND_ARBITRARY(j, nv_pass_fold_stores);