Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
debeec92
Commit
debeec92
authored
Nov 08, 2004
by
Michael Beck
Browse files
Added statistic code
added commutative Rules for And, Or, Eor [r4310]
parent
94317f78
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/opt/reassoc.c
View file @
debeec92
...
...
@@ -258,6 +258,9 @@ static int reassoc_commutative(ir_node *n)
}
#define reassoc_Add reassoc_commutative
#define reassoc_And reassoc_commutative
#define reassoc_Or reassoc_commutative
#define reassoc_Eor reassoc_commutative
/**
* reassociate using distibutive law for Mul and Add/Sub
...
...
@@ -310,6 +313,8 @@ static void do_reassociation(ir_node *n, void *env)
walker_t
*
wenv
=
env
;
int
res
;
stat_reassociate
(
1
);
/* reassociation must run until fixpoint */
do
{
ir_op
*
op
=
get_irn_op
(
n
);
...
...
@@ -328,6 +333,8 @@ static void do_reassociation(ir_node *n, void *env)
}
}
}
while
(
res
==
1
);
stat_reassociate
(
0
);
}
/*
...
...
@@ -364,5 +371,8 @@ void firm_init_reassociation(void)
INIT
(
Mul
);
INIT
(
Add
);
INIT
(
Sub
);
INIT
(
And
);
INIT
(
Or
);
INIT
(
Eor
);
#undef CASE
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment