summaryrefslogtreecommitdiffhomepage
path: root/ir/be/beblocksched.c
diff options
context:
space:
mode:
authorChristoph Mallon <christoph.mallon@gmx.de>2014-03-29 10:13:39 +0100
committerChristoph Mallon <christoph.mallon@gmx.de>2014-04-10 10:33:55 +0200
commit1966adc74b7dc4a47f556d36628019beeb3f6d0d (patch)
treeb742c3a080dc2fd527d77849651ca2d8a547fb1a /ir/be/beblocksched.c
parent5512229a51005fec43bac48ff09c64251b392754 (diff)
all: Add and use QSORT() and QSORT_ARR().
Diffstat (limited to 'ir/be/beblocksched.c')
-rw-r--r--ir/be/beblocksched.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/ir/be/beblocksched.c b/ir/be/beblocksched.c
index 3b18e14..7c9da85 100644
--- a/ir/be/beblocksched.c
+++ b/ir/be/beblocksched.c
@@ -23,6 +23,7 @@
#include <stdlib.h>
+#include "../../adt/util.h"
#include "array.h"
#include "pdeq.h"
#include "beirg.h"
@@ -256,7 +257,7 @@ static void coalesce_blocks(blocksched_env_t *env)
edge_t *edges = env->edges;
/* sort interblock edges by execution frequency */
- qsort(edges, ARR_LEN(edges), sizeof(edges[0]), cmp_edges);
+ QSORT_ARR(edges, cmp_edges);
/* run1: only look at jumps */
for (i = 0; i < edge_count; ++i) {
@@ -295,7 +296,7 @@ static void coalesce_blocks(blocksched_env_t *env)
/* run2: pick loop fallthroughs */
clear_loop_links(get_irg_loop(env->irg));
- qsort(edges, ARR_LEN(edges), sizeof(edges[0]), cmp_edges_outedge_penalty);
+ QSORT_ARR(edges, cmp_edges_outedge_penalty);
for (i = 0; i < edge_count; ++i) {
const edge_t *edge = &edges[i];
ir_node *block = edge->block;
@@ -341,7 +342,7 @@ static void coalesce_blocks(blocksched_env_t *env)
}
/* sort interblock edges by execution frequency */
- qsort(edges, ARR_LEN(edges), sizeof(edges[0]), cmp_edges);
+ QSORT_ARR(edges, cmp_edges);
/* run3: remaining edges */
for (i = 0; i < edge_count; ++i) {