set the isa right
[libfirm] / ir / be / arm / bearch_arm.c
index dae0157..2913be8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1995-2007 University of Karlsruhe.  All right reserved.
+ * Copyright (C) 1995-2008 University of Karlsruhe.  All right reserved.
  *
  * This file is part of libFirm.
  *
@@ -27,8 +27,8 @@
 #include "config.h"
 #endif
 
-#include <libcore/lc_opts.h>
-#include <libcore/lc_opts_enum.h>
+#include "lc_opts.h"
+#include "lc_opts_enum.h"
 
 #include "pseudo_irg.h"
 #include "irgwalk.h"
@@ -37,6 +37,7 @@
 #include "ircons.h"
 #include "irgmod.h"
 #include "irgopt.h"
+#include "iroptimize.h"
 #include "lowering.h"
 
 #include "bitset.h"
@@ -203,17 +204,26 @@ static arch_irn_class_t arm_classify(const void *self, const ir_node *irn)
 
 static arch_irn_flags_t arm_get_flags(const void *self, const ir_node *irn)
 {
+       arch_irn_flags_t flags = arch_irn_flags_none;
        (void) self;
-       irn = skip_Proj_const(irn);
 
-       if (is_arm_irn(irn)) {
-               return get_arm_flags(irn);
-       }
-       else if (is_Unknown(irn)) {
+       if(is_Unknown(irn)) {
                return arch_irn_flags_ignore;
        }
 
-       return 0;
+       if (is_Proj(irn) && mode_is_datab(get_irn_mode(irn))) {
+               ir_node *pred = get_Proj_pred(irn);
+               if (is_arm_irn(pred)) {
+                       flags = get_arm_out_flags(pred, get_Proj_proj(irn));
+               }
+               irn = pred;
+       }
+
+       if (is_arm_irn(irn)) {
+               flags |= get_arm_flags(irn);
+       }
+
+       return flags;
 }
 
 static ir_entity *arm_get_frame_entity(const void *self, const ir_node *irn)
@@ -937,8 +947,7 @@ static const arch_register_t *arm_abi_prologue(void *self, ir_node **mem, pmap *
        arch_set_irn_register(env->arch_env, keep, &arm_gp_regs[REG_R12]);
        be_set_constr_single_reg(keep, BE_OUT_POS(0), &arm_gp_regs[REG_R12] );
 
-       fp = new_rd_arm_Sub_i(NULL, irg, block, keep, get_irn_mode(fp),
-                             new_tarval_from_long(4, get_irn_mode(fp)));
+       fp = new_rd_arm_Sub_i(NULL, irg, block, keep, get_irn_mode(fp), 4);
        arch_set_irn_register(env->arch_env, fp, env->isa->bp);
 
        be_abi_reg_map_set(reg_map, env->isa->bp, fp);
@@ -977,8 +986,7 @@ static void arm_abi_epilogue(void *self, ir_node *bl, ir_node **mem, pmap *reg_m
        } else {
                ir_node *sub12_node;
                ir_node *load_node;
-               tarval *tv = new_tarval_from_long(12,mode_Iu);
-               sub12_node = new_rd_arm_Sub_i(NULL, env->irg, bl, curr_bp, mode_Iu, tv);
+               sub12_node = new_rd_arm_Sub_i(NULL, env->irg, bl, curr_bp, mode_Iu, 12);
                // FIXME
                //set_arm_req_out_all(sub12_node, sub12_req);
                arch_set_irn_register(env->arch_env, sub12_node, env->isa->sp);
@@ -1119,10 +1127,11 @@ list_sched_selector_t arm_sched_selector;
  */
 static const list_sched_selector_t *arm_get_list_sched_selector(const void *self, list_sched_selector_t *selector) {
        (void) self;
-       (void) selector;
-       arm_sched_selector = reg_pressure_selector;
+       memcpy(&arm_sched_selector, selector, sizeof(arm_sched_selector));
+       /* arm_sched_selector.exectime              = arm_sched_exectime; */
        arm_sched_selector.to_appear_in_schedule = arm_to_appear_in_schedule;
        return &arm_sched_selector;
+
 }
 
 static const ilp_sched_selector_t *arm_get_ilp_sched_selector(const void *self) {