- simplied code by removing a goto
[libfirm] / ir / be / ia32 / bearch_ia32.c
index 180bd7a..9cf6a01 100644 (file)
@@ -867,11 +867,18 @@ static void ia32_before_abi(void *self) {
  * Transforms the standard firm graph into
  * an ia32 firm graph
  */
-static void ia32_prepare_graph(void *self) {
-       ia32_code_gen_t *cg = self;
+static void ia32_prepare_graph(void *self)
+{
+       ia32_code_gen_t *cg  = self;
+       ir_graph        *irg = cg->irg;
 
        /* do local optimizations */
-       optimize_graph_df(cg->irg);
+       optimize_graph_df(irg);
+
+       /* we have to do cfopt+remove_critical_edges as we can't have Bad-blocks
+        * or critical edges in the backend */
+       optimize_cf(irg);
+       remove_critical_cf_edges(irg);
 
        /* TODO: we often have dead code reachable through out-edges here. So for
         * now we rebuild edges (as we need correct user count for code selection)
@@ -2304,13 +2311,12 @@ static const backend_params *ia32_get_libfirm_params(void) {
 
                1,  /* allow Mulhs */
                1,  /* allow Mulus */
-               32  /* Mulh allowed up to 32 bit */
+               32, /* Mulh allowed up to 32 bit */
        };
        static backend_params p = {
                1,     /* need dword lowering */
                1,     /* support inline assembly */
                0,     /* no immediate floating point mode. */
-               NULL,  /* no additional opcodes */
                NULL,  /* will be set later */
                ia32_create_intrinsic_fkt,
                &intrinsic_env,  /* context for ia32_create_intrinsic_fkt */