Handle multiple control dependencies in a more sophisticated (and correct) way
[libfirm] / ir / opt / scalar_replace.h
index d9f8594..4ed3f1f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Project:     libFIRM
  * File name:   ir/opt/scalar_replace.h
- * Purpose:     scalar replacement of arrays and compounds
+ * Purpose:     scalar replacement of compounds
  * Author:      Beyhan Veliev
  * Created:
  * CVS-ID:      $Id$
@@ -9,31 +9,26 @@
  * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
  */
 
-# ifndef _SCALAR_REPLACE_H_
-# define _SCALAR_REPLACE_H_
+#ifndef _SCALAR_REPLACE_H_
+#define _SCALAR_REPLACE_H_
 
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "tv.h"
-#include "irgraph_t.h"
-#include "irouts.h"
-#include "pset.h"
-#include "hashptr.h"
-#include "irdump.h"
-#include "ircons.h"
-#include "irgmod.h"
-#include "obst.h"
-#include "irloop.h"
-#include "irdom.h"
-#include "irflag_t.h"
-#include "array.h"
+#include "irgraph.h"
 
+/**
+ * Returns non-zero, if the address of an entity
+ * represented by a Sel node (or it's successor Sels) is taken.
+ *
+ * @param sel  the Sel node
+ */
+int is_address_taken(ir_node *sel);
 
-/*
- * find possible scalar replacements
+/**
+ * Do the scalar replacement optimization.
+ * Replace local compound entities (like structures and arrays)
+ * with atomic values if possible. Does not handle classes yet.
+ *
+ * @param irg  the graph which should be optimized
  */
-void find_scalar_replacements(ir_graph *irg);
+void scalar_replacement_opt(ir_graph *irg);
 
 #endif /* _SCALAR_REPLACE_H_ */