ia32: we cannot fold ia32_mode_E reloads
authorMatthias Braun <matze@braunis.de>
Mon, 17 Dec 2012 16:39:34 +0000 (17:39 +0100)
committerMatthias Braun <matze@braunis.de>
Mon, 17 Dec 2012 16:42:47 +0000 (17:42 +0100)
ir/be/ia32/bearch_ia32.c

index 2592c0c..2fa4362 100644 (file)
@@ -350,15 +350,6 @@ static ir_mode *get_spill_mode(const ir_node *node)
        return get_spill_mode_mode(mode);
 }
 
-/**
- * Checks whether an addressmode reload for a node with mode mode is compatible
- * with a spillslot of mode spill_mode
- */
-static int ia32_is_spillmode_compatible(const ir_mode *mode, const ir_mode *spillmode)
-{
-       return !mode_is_float(mode) || mode == spillmode;
-}
-
 /**
  * Check if irn can load its operand at position i from memory (source addressmode).
  * @param irn    The irn to be checked
@@ -369,13 +360,16 @@ static int ia32_possible_memory_operand(const ir_node *irn, unsigned int i)
 {
        ir_node       *op        = get_irn_n(irn, i);
        const ir_mode *mode      = get_irn_mode(op);
-       const ir_mode *spillmode = get_spill_mode(op);
 
        if (!is_ia32_irn(irn)                              ||  /* must be an ia32 irn */
            get_ia32_op_type(irn) != ia32_Normal           ||  /* must not already be a addressmode irn */
-           !ia32_is_spillmode_compatible(mode, spillmode) ||
            is_ia32_use_frame(irn))                            /* must not already use frame */
                return 0;
+       if (mode_is_float(mode)) {
+               ir_mode *spillmode = get_spill_mode_mode(mode);
+               if (spillmode != mode_D && spillmode != mode_F)
+                       return 0;
+       }
 
        switch (get_ia32_am_support(irn)) {
                case ia32_am_none: