summaryrefslogtreecommitdiffhomepage
path: root/ir/be/beirg.c
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2006-12-14 16:24:10 +0100
committerMatthias Braun <matze@braunis.de>2006-12-14 16:24:10 +0100
commitc65b13d98017c671496ff61e970790bba264f375 (patch)
tree6f2d2b44e5dd858ae6d5b4a0e2ea3609b0fb8732 /ir/be/beirg.c
parent208809bd4713035389ccb0575b2592f52db6816b (diff)
move birg to an own file, use more of the birg analysis data
Diffstat (limited to 'ir/be/beirg.c')
-rw-r--r--ir/be/beirg.c61
1 files changed, 61 insertions, 0 deletions
diff --git a/ir/be/beirg.c b/ir/be/beirg.c
new file mode 100644
index 0000000..42460de
--- /dev/null
+++ b/ir/be/beirg.c
@@ -0,0 +1,61 @@
+/*
+ * Author: Matthias Braun
+ * Date: 13.12.2006
+ * Copyright: (c) Universitaet Karlsruhe
+ * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
+ */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "execfreq.h"
+#include "beirg_t.h"
+
+void be_assure_liveness(be_irg_t *birg)
+{
+ if(birg->lv != NULL)
+ return;
+
+ birg->lv = be_liveness(birg->irg);
+}
+
+void be_invalidate_liveness(be_irg_t *birg)
+{
+ if(birg->lv == NULL)
+ return;
+
+ be_liveness_free(birg->lv);
+ birg->lv = NULL;
+}
+
+void be_assure_dom_front(be_irg_t *birg)
+{
+ if(birg->dom_front != NULL)
+ return;
+
+ birg->dom_front = be_compute_dominance_frontiers(birg->irg);
+}
+
+void be_invalidate_dom_front(be_irg_t *birg)
+{
+ if(birg->dom_front == NULL)
+ return;
+
+ be_free_dominance_frontiers(birg->dom_front);
+ birg->dom_front = NULL;
+}
+
+void be_free_birg(be_irg_t *birg)
+{
+ free_execfreq(birg->exec_freq);
+ birg->exec_freq = NULL;
+
+ if(birg->dom_front != NULL) {
+ be_free_dominance_frontiers(birg->dom_front);
+ birg->dom_front = NULL;
+ }
+ if(birg->lv != NULL) {
+ be_liveness_free(birg->lv);
+ birg->lv = NULL;
+ }
+}