projects
/
libfirm
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix warnings
[libfirm]
/
ir
/
kaps
/
brute_force.c
diff --git
a/ir/kaps/brute_force.c
b/ir/kaps/brute_force.c
index
94111ce
..
ca8f975
100644
(file)
--- a/
ir/kaps/brute_force.c
+++ b/
ir/kaps/brute_force.c
@@
-22,7
+22,6
@@
* @brief Brute force PBQP solver.
* @date 02.12.2008
* @author Sebastian Buchwald
* @brief Brute force PBQP solver.
* @date 02.12.2008
* @author Sebastian Buchwald
- * @version $Id$
*/
#include "config.h"
*/
#include "config.h"
@@
-32,7
+31,7
@@
#include "bucket.h"
#include "brute_force.h"
#include "optimal.h"
#include "bucket.h"
#include "brute_force.h"
#include "optimal.h"
-#if
KAPS_DUMP
+#if KAPS_DUMP
#include "html_dumper.h"
#endif
#include "kaps.h"
#include "html_dumper.h"
#endif
#include "kaps.h"
@@
-77,7
+76,6
@@
static unsigned get_minimal_alternative(pbqp_t *pbqp, pbqp_node_t *node)
unsigned bucket_index;
assert(pbqp);
unsigned bucket_index;
assert(pbqp);
- assert(node);
node_vec = node->costs;
node_len = node_vec->len;
bucket_index = node->bucket_index;
node_vec = node->costs;
node_len = node_vec->len;
bucket_index = node->bucket_index;
@@
-151,14
+149,13
@@
static void apply_Brute_Force(pbqp_t *pbqp)
/* We want to reduce a node with maximum degree. */
node = get_node_with_max_degree();
/* We want to reduce a node with maximum degree. */
node = get_node_with_max_degree();
- assert(node);
assert(pbqp_node_get_degree(node) > 2);
assert(pbqp_node_get_degree(node) > 2);
-#if
KAPS_DUMP
+#if KAPS_DUMP
if (pbqp->dump_file) {
char txt[100];
sprintf(txt, "BF-Reduction of Node n%d", node->index);
if (pbqp->dump_file) {
char txt[100];
sprintf(txt, "BF-Reduction of Node n%d", node->index);
- dump_section(pbqp->dump_file, 2, txt);
+
pbqp_
dump_section(pbqp->dump_file, 2, txt);
pbqp_dump_graph(pbqp);
}
#endif
pbqp_dump_graph(pbqp);
}
#endif
@@
-170,7
+167,7
@@
static void apply_Brute_Force(pbqp_t *pbqp)
min_index = get_minimal_alternative(pbqp, node);
node = pbqp->nodes[node->index];
min_index = get_minimal_alternative(pbqp, node);
node = pbqp->nodes[node->index];
-#if
KAPS_DUMP
+#if KAPS_DUMP
if (pbqp->dump_file) {
fprintf(pbqp->dump_file, "node n%d is set to %d<br><br>\n",
node->index, min_index);
if (pbqp->dump_file) {
fprintf(pbqp->dump_file, "node n%d is set to %d<br><br>\n",
node->index, min_index);
@@
-202,7
+199,6
@@
static void back_propagate_RI(pbqp_t *pbqp, pbqp_node_t *node)
int is_src;
assert(pbqp);
int is_src;
assert(pbqp);
- assert(node);
edge = node->edges[0];
mat = edge->costs;
edge = node->edges[0];
mat = edge->costs;
@@
-211,7
+207,6
@@
static void back_propagate_RI(pbqp_t *pbqp, pbqp_node_t *node)
if (is_src) {
other = edge->tgt;
if (is_src) {
other = edge->tgt;
- assert(other);
/* Update pointer for brute force solver. */
other = pbqp->nodes[other->index];
/* Update pointer for brute force solver. */
other = pbqp->nodes[other->index];
@@
-219,7
+214,6
@@
static void back_propagate_RI(pbqp_t *pbqp, pbqp_node_t *node)
node->solution = pbqp_matrix_get_col_min_index(mat, other->solution, vec);
} else {
other = edge->src;
node->solution = pbqp_matrix_get_col_min_index(mat, other->solution, vec);
} else {
other = edge->src;
- assert(other);
/* Update pointer for brute force solver. */
other = pbqp->nodes[other->index];
/* Update pointer for brute force solver. */
other = pbqp->nodes[other->index];
@@
-227,7
+221,7
@@
static void back_propagate_RI(pbqp_t *pbqp, pbqp_node_t *node)
node->solution = pbqp_matrix_get_row_min_index(mat, other->solution, vec);
}
node->solution = pbqp_matrix_get_row_min_index(mat, other->solution, vec);
}
-#if
KAPS_DUMP
+#if KAPS_DUMP
if (pbqp->dump_file) {
fprintf(pbqp->dump_file, "node n%d is set to %d<br>\n", node->index, node->solution);
}
if (pbqp->dump_file) {
fprintf(pbqp->dump_file, "node n%d is set to %d<br>\n", node->index, node->solution);
}
@@
-308,7
+302,7
@@
static void back_propagate_RII(pbqp_t *pbqp, pbqp_node_t *node)
node->solution = vector_get_min_index(vec);
node->solution = vector_get_min_index(vec);
-#if
KAPS_DUMP
+#if KAPS_DUMP
if (pbqp->dump_file) {
fprintf(pbqp->dump_file, "node n%d is set to %d<br>\n", node->index, node->solution);
}
if (pbqp->dump_file) {
fprintf(pbqp->dump_file, "node n%d is set to %d<br>\n", node->index, node->solution);
}
@@
-324,9
+318,9
@@
static void back_propagate_brute_force(pbqp_t *pbqp)
assert(pbqp);
assert(pbqp);
-#if
KAPS_DUMP
+#if KAPS_DUMP
if (pbqp->dump_file) {
if (pbqp->dump_file) {
- dump_section(pbqp->dump_file, 2, "Back Propagation");
+
pbqp_
dump_section(pbqp->dump_file, 2, "Back Propagation");
}
#endif
}
#endif
@@
-342,7
+336,6
@@
static void back_propagate_brute_force(pbqp_t *pbqp)
break;
default:
panic("Only nodes with degree one or two should be in this bucket");
break;
default:
panic("Only nodes with degree one or two should be in this bucket");
- break;
}
}
}
}
}
}