r300/compiler: rc_reader_data: Add ExitOnAbort flag
authorTom Stellard <tstellar@gmail.com>
Sun, 30 Jan 2011 23:29:29 +0000 (15:29 -0800)
committerTom Stellard <tstellar@gmail.com>
Sat, 30 Apr 2011 18:00:15 +0000 (11:00 -0700)
src/mesa/drivers/dri/r300/compiler/radeon_dataflow.c
src/mesa/drivers/dri/r300/compiler/radeon_dataflow.h
src/mesa/drivers/dri/r300/compiler/radeon_optimize.c
src/mesa/drivers/dri/r300/compiler/radeon_pair_schedule.c
src/mesa/drivers/dri/r300/compiler/radeon_rename_regs.c

index b4837091d949cd180a80d60cae8d50b78da84a39..3c0ab10aa56b1a14638865a462b1e5db9f7b370e 100644 (file)
@@ -592,7 +592,7 @@ static void get_readers_pair_read_callback(
        if (d->ReadPairCB)
                d->ReadPairCB(d->ReaderData, inst, arg, src);
 
-       if (d->ReaderData->Abort)
+       if (d->ReaderData->ExitOnAbort && d->ReaderData->Abort)
                return;
 
        add_reader_pair(&d->C->Pool, d->ReaderData, inst, shared_mask, arg, src);
@@ -620,7 +620,7 @@ static void get_readers_normal_read_callback(
        if (d->ReadNormalCB)
                d->ReadNormalCB(d->ReaderData, inst, src);
 
-       if (d->ReaderData->Abort)
+       if (d->ReaderData->ExitOnAbort && d->ReaderData->Abort)
                return;
 
        add_reader_normal(&d->C->Pool, d->ReaderData, inst, shared_mask, src);
@@ -767,7 +767,7 @@ static void get_readers_for_single_write(
                }
                rc_for_all_writes_mask(tmp, get_readers_write_callback, d);
 
-               if (d->ReaderData->Abort)
+               if (d->ReaderData->ExitOnAbort && d->ReaderData->Abort)
                        return;
 
                if (branch_depth == 0 && !d->AliveWriteMask)
index 77d5d74d859025a3e865c3850c1389100ec2b61b..1e30cc696953d38414ee776bf2c74aea44c28330 100644 (file)
@@ -94,6 +94,9 @@ struct rc_reader_data {
        unsigned int ReadersReserved;
        struct rc_reader * Readers;
 
+       /* If this flag is enabled, rc_get_readers will exit as soon possbile
+        * after the Abort flag is set.*/
+       unsigned int ExitOnAbort;
        void * CbData;
 };
 
index 104f7bf6baf2a71004c227999212b210f94f4eb0..447193ee81770daa6582fbd023fc972f3cde2494 100644 (file)
@@ -144,6 +144,7 @@ static void copy_propagate(struct radeon_compiler * c, struct rc_instruction * i
                return;
 
        /* Get a list of all the readers of this MOV instruction. */
+       reader_data.ExitOnAbort = 1;
        rc_get_readers(c, inst_mov, &reader_data,
                       copy_propagate_scan_read, NULL,
                       is_src_clobbered_scan_write);
@@ -453,6 +454,7 @@ static int presub_helper(
        rc_presubtract_op cb_op = presub_opcode;
 
        reader_data.CbData = &cb_op;
+       reader_data.ExitOnAbort = 1;
        rc_get_readers(c, inst_add, &reader_data, presub_scan_read, NULL,
                                                is_src_clobbered_scan_write);
 
index dad8ef59355b358936295ba0ba4ed076da126774..3743b0239d4ee0bf6fa00a5c50f8a809acdd1b58 100644 (file)
@@ -952,6 +952,7 @@ static void schedule_block(struct r300_fragment_program_compiler * c,
                        instruction_ready(&s, s.Current);
 
                /* Get global readers for possible RGB->Alpha conversion. */
+               s.Current->GlobalReaders.ExitOnAbort = 1;
                rc_get_readers(s.C, inst, &s.Current->GlobalReaders,
                                is_rgb_to_alpha_possible_normal,
                                is_rgb_to_alpha_possible, NULL);
index d4d96b4c0ca4454f8478fa3188c32c4fa2b33862..cafa057973433fe97e35d06689ddc0468e04e341 100644 (file)
@@ -71,6 +71,7 @@ void rc_rename_regs(struct radeon_compiler *c, void *user)
                if (inst->U.I.DstReg.File != RC_FILE_TEMPORARY)
                        continue;
 
+               reader_data.ExitOnAbort = 1;
                rc_get_readers(c, inst, &reader_data, NULL, NULL, NULL);
 
                if (reader_data.Abort || reader_data.ReaderCount == 0)