[Mesa-dev] [PATCH 07/23] i965/fs: Print disassembly after compaction.
Matt Turner
mattst88 at gmail.com
Wed May 21 11:09:40 PDT 2014
On Wed, May 21, 2014 at 9:52 AM, Juha-Pekka Heikkilä
<juhapekka.heikkila at gmail.com> wrote:
> On Mon, May 19, 2014 at 9:55 PM, Matt Turner <mattst88 at gmail.com> wrote:
>> ---
>> src/mesa/drivers/dri/i965/brw_fs.h | 4 +-
>> src/mesa/drivers/dri/i965/brw_fs_generator.cpp | 156 ++++++++++++-------------
>> 2 files changed, 77 insertions(+), 83 deletions(-)
>>
>> diff --git a/src/mesa/drivers/dri/i965/brw_fs.h b/src/mesa/drivers/dri/i965/brw_fs.h
>> index 111e994..d26b972 100644
>> --- a/src/mesa/drivers/dri/i965/brw_fs.h
>> +++ b/src/mesa/drivers/dri/i965/brw_fs.h
>> @@ -46,6 +46,7 @@ extern "C" {
>> #include "brw_eu.h"
>> #include "brw_wm.h"
>> #include "brw_shader.h"
>> +#include "intel_asm_printer.h"
>> }
>> #include "gen8_generator.h"
>> #include "glsl/glsl_types.h"
>> @@ -611,7 +612,8 @@ public:
>> unsigned *assembly_size);
>>
>> private:
>> - void generate_code(exec_list *instructions);
>> + void generate_code(exec_list *instructions, int *num_annotations,
>> + struct annotation **annotation);
>> void generate_fb_write(fs_inst *inst);
>> void generate_blorp_fb_write(fs_inst *inst);
>> void generate_pixel_xy(struct brw_reg dst, bool is_x);
>> diff --git a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
>> index 132d5cd..b0b3b56 100644
>> --- a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
>> +++ b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
>> @@ -1322,12 +1322,9 @@ fs_generator::generate_untyped_surface_read(fs_inst *inst, struct brw_reg dst,
>> }
>>
>> void
>> -fs_generator::generate_code(exec_list *instructions)
>> +fs_generator::generate_code(exec_list *instructions, int *num_annotations,
>> + struct annotation **annotation)
>> {
>> - int last_native_insn_offset = p->next_insn_offset;
>> - const char *last_annotation_string = NULL;
>> - const void *last_annotation_ir = NULL;
>> -
>> if (unlikely(debug_flag)) {
>> if (prog) {
>> fprintf(stderr,
>> @@ -1344,54 +1341,52 @@ fs_generator::generate_code(exec_list *instructions)
>> }
>> }
>>
>> + int block_num = 0;
>> + int ann_num = 0;
>> + int ann_size = 1024;
>> cfg_t *cfg = NULL;
>> - if (unlikely(debug_flag))
>> + struct annotation *ann = NULL;
>> +
>> + if (unlikely(debug_flag)) {
>> cfg = new(mem_ctx) cfg_t(instructions);
>> + ann = rzalloc_array(NULL, struct annotation, ann_size);
>
> I know cfg and ann will be complained about by Klocwork for not being
> checked for nullness.
Okay, thanks. I'll modify all of the if(unlikely(debug_flag)) to be if
(unlikely(debug_flag) && ann != NULL).
Patches 8-10 all contain this pattern, so I'll fix them up too.
More information about the mesa-dev
mailing list