foreach_block (block, &ir->block_list) {
foreach_instr (instr, &block->instr_list) {
- struct ir3_instruction *src;
-
foreach_ssa_src_n (src, n, instr) {
if (__is_false_dep(instr, n) && !falsedeps)
continue;
/* iterator for an instruction's SSA sources (instr), also returns src #: */
#define foreach_ssa_src_n(__srcinst, __n, __instr) \
- foreach_ssa_srcp_n(__srcp, __n, __instr) \
- if ((__srcinst = *__srcp))
+ for (struct ir3_instruction *__srcinst = (void *)~0; __srcinst; __srcinst = NULL) \
+ foreach_ssa_srcp_n(__srcp, __n, __instr) \
+ if ((__srcinst = *__srcp))
/* iterator for an instruction's SSA sources (instr): */
#define foreach_ssa_src(__srcinst, __instr) \
rewrite_uses(struct ir3_instruction *conv, struct ir3_instruction *replace)
{
foreach_ssa_use (use, conv) {
- struct ir3_instruction *src;
foreach_ssa_src_n (src, n, use) {
if (src == conv)
use->regs[n]->instr = replace;
*/
foreach_block (block, &ir->block_list) {
foreach_instr (instr, &block->instr_list) {
- struct ir3_instruction *src;
/* by the way, we don't account for false-dep's, so the CP
* pass should always happen before false-dep's are inserted
static void
instr_dce(struct ir3_instruction *instr, bool falsedep)
{
- struct ir3_instruction *src;
-
/* don't mark falsedep's as used, but otherwise process them normally: */
if (!falsedep)
instr->flags &= ~IR3_INSTR_UNUSED;
static bool
instr_find_neighbors(struct ir3_instruction *instr)
{
- struct ir3_instruction *src;
bool progress = false;
if (ir3_instr_check_mark(instr))
*/
foreach_instr (instr, &ctx->unscheduled_list) {
struct ir3_postsched_node *n = instr->data;
- struct ir3_instruction *src;
foreach_ssa_src_n (src, i, instr) {
if (src->block != instr->block)
* collect srcs as partially live.
*/
if (n->collect) {
- struct ir3_instruction *src;
foreach_ssa_src (src, n->collect) {
if (src->block != instr->block)
continue;
static bool
could_sched(struct ir3_instruction *instr, struct ir3_instruction *src)
{
- struct ir3_instruction *other_src;
foreach_ssa_src (other_src, instr) {
/* if dependency not scheduled, we aren't ready yet: */
if ((src != other_src) && !is_scheduled(other_src)) {
live_effect(struct ir3_instruction *instr)
{
struct ir3_sched_node *n = instr->data;
- struct ir3_instruction *src;
int new_live = n->partially_live ? 0 : dest_regs(instr);
int freed_live = 0;
{
struct ir3_sched_node *n = instr->data;
n->kill_path = true;
- struct ir3_instruction *src;
+
foreach_ssa_src (src, instr) {
if (src->block != instr->block)
continue;
static void
sched_node_add_deps(struct ir3_instruction *instr)
{
- struct ir3_instruction *src;
-
/* Since foreach_ssa_src() already handles false-dep's we can construct
* the DAG easily in a single pass.
*/