2 * Copyright (C) 2009 Nicolai Haehnle.
6 * Permission is hereby granted, free of charge, to any person obtaining
7 * a copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sublicense, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial
16 * portions of the Software.
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
21 * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
22 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
23 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28 #ifndef RADEON_DATAFLOW_H
29 #define RADEON_DATAFLOW_H
31 #include "radeon_program_constants.h"
33 struct radeon_compiler
;
34 struct rc_instruction
;
35 struct rc_swizzle_caps
;
39 * Help analyze the register accesses of instructions.
42 typedef void (*rc_read_write_fn
)(void * userdata
, struct rc_instruction
* inst
,
43 rc_register_file file
, unsigned int index
, unsigned int chan
);
44 void rc_for_all_reads(struct rc_instruction
* inst
, rc_read_write_fn cb
, void * userdata
);
45 void rc_for_all_writes(struct rc_instruction
* inst
, rc_read_write_fn cb
, void * userdata
);
50 * Compiler passes based on dataflow analysis.
53 typedef void (*rc_dataflow_mark_outputs_fn
)(void * userdata
, void * data
,
54 void (*mark_fn
)(void * data
, unsigned int index
, unsigned int mask
));
55 void rc_dataflow_deadcode(struct radeon_compiler
* c
, rc_dataflow_mark_outputs_fn dce
, void * userdata
);
56 void rc_dataflow_swizzles(struct radeon_compiler
* c
);
59 #endif /* RADEON_DATAFLOW_H */