simplify/rework lower_calls interface and code
[libfirm] / ir / be / bepeephole.c
index 07e3ab1..3649a91 100644 (file)
@@ -132,9 +132,9 @@ void be_peephole_new_node(ir_node * nw)
 /**
  * must be called from peephole optimisations before a node will be killed
  * and its users will be redirected to new_node.
- * so bepeephole can update it's internal state.
+ * so bepeephole can update its internal state.
  *
- * Note: killing a node and rewiring os only allowed if new_node produces
+ * Note: killing a node and rewiring is only allowed if new_node produces
  * the same registers as old_node.
  */
 static void be_peephole_before_exchange(const ir_node *old_node,
@@ -277,23 +277,7 @@ ir_node *be_peephole_IncSP_IncSP(ir_node *node)
 
        pred_offs = be_get_IncSP_offset(pred);
        curr_offs = be_get_IncSP_offset(node);
-
-       if (pred_offs == BE_STACK_FRAME_SIZE_EXPAND) {
-               if (curr_offs != BE_STACK_FRAME_SIZE_SHRINK) {
-                       return node;
-               }
-               offs = 0;
-       } else if (pred_offs == BE_STACK_FRAME_SIZE_SHRINK) {
-               if (curr_offs != BE_STACK_FRAME_SIZE_EXPAND) {
-                       return node;
-               }
-               offs = 0;
-       } else if (curr_offs == BE_STACK_FRAME_SIZE_EXPAND ||
-                  curr_offs == BE_STACK_FRAME_SIZE_SHRINK) {
-               return node;
-       } else {
-               offs = curr_offs + pred_offs;
-       }
+       offs = curr_offs + pred_offs;
 
        /* add node offset to pred and remove our IncSP */
        be_set_IncSP_offset(pred, offs);
@@ -331,7 +315,7 @@ void be_peephole_opt(ir_graph *irg)
        xfree(register_values);
 }
 
-BE_REGISTER_MODULE_CONSTRUCTOR(be_init_peephole);
+BE_REGISTER_MODULE_CONSTRUCTOR(be_init_peephole)
 void be_init_peephole(void)
 {
        FIRM_DBG_REGISTER(dbg, "firm.be.peephole");