Author: zoltan
Date: 2008-01-18 11:41:44 -0500 (Fri, 18 Jan 2008)
New Revision: 93273

Modified:
   trunk/mono/mono/mini/ChangeLog
   trunk/mono/mono/mini/mini-amd64.c
Log:
2008-01-18  Zoltan Varga  <[EMAIL PROTECTED]>

        * mini-amd64.c (mono_arch_call_opcode): Emit the save_sp_to_lmf 
instruction at
        the end.
        (mono_arch_emit_prolog): Add more first bblock optimizations.


Modified: trunk/mono/mono/mini/ChangeLog
===================================================================
--- trunk/mono/mono/mini/ChangeLog      2008-01-18 16:27:26 UTC (rev 93272)
+++ trunk/mono/mono/mini/ChangeLog      2008-01-18 16:41:44 UTC (rev 93273)
@@ -1,5 +1,9 @@
 2008-01-18  Zoltan Varga  <[EMAIL PROTECTED]>
 
+       * mini-amd64.c (mono_arch_call_opcode): Emit the save_sp_to_lmf 
instruction at
+       the end.
+       (mono_arch_emit_prolog): Add more first bblock optimizations.
+
        * mini-amd64.c (mono_arch_call_opcode): Keep assignments to the arg 
registers
        in order if possible.
        (mono_arch_emit_prolog): Optimize assignments to arg registers in the 
first

Modified: trunk/mono/mono/mini/mini-amd64.c
===================================================================
--- trunk/mono/mono/mini/mini-amd64.c   2008-01-18 16:27:26 UTC (rev 93272)
+++ trunk/mono/mono/mini/mini-amd64.c   2008-01-18 16:41:44 UTC (rev 93273)
@@ -1278,11 +1278,6 @@
 
        cinfo = get_call_info (cfg, cfg->mempool, sig, sig->pinvoke);
 
-       if (cfg->method->save_lmf) {
-               MONO_INST_NEW (cfg, arg, OP_AMD64_SAVE_SP_TO_LMF);
-               MONO_INST_LIST_ADD (&arg->node, &call->out_args);
-       }
-
        for (i = 0; i < n; ++i) {
                ainfo = cinfo->args + i;
 
@@ -1431,6 +1426,11 @@
                MONO_INST_LIST_ADD (&arg->node, &call->out_args);
        }
 
+       if (cfg->method->save_lmf) {
+               MONO_INST_NEW (cfg, arg, OP_AMD64_SAVE_SP_TO_LMF);
+               MONO_INST_LIST_ADD_TAIL (&arg->node, &call->out_args);
+       }
+
        call->stack_usage = cinfo->stack_usage;
        cfg->param_area = MAX (cfg->param_area, call->stack_usage);
        cfg->flags |= MONO_CFG_HAS_CALLS;
@@ -4720,9 +4720,16 @@
                        if (ins->opcode != OP_REGVAR) {
                                switch (ainfo->storage) {
                                case ArgInIReg: {
-                                       if (next->opcode == OP_LOAD_MEMBASE && 
next->inst_basereg == ins->inst_basereg && next->inst_offset == 
ins->inst_offset && next->dreg == ainfo->reg) {
-                                               NULLIFY_INS (next);
-                                               match = TRUE;
+                                       if (((next->opcode == OP_LOAD_MEMBASE) 
|| (next->opcode == OP_LOADI4_MEMBASE)) && next->inst_basereg == 
ins->inst_basereg && next->inst_offset == ins->inst_offset) {
+                                               if (next->dreg == ainfo->reg)
+                                                       NULLIFY_INS (next);
+                                               else {
+                                                       next->opcode = OP_MOVE;
+                                                       next->sreg1 = 
ainfo->reg;
+                                               }
+                                               /* Only continue if the 
instruction doesn't change argument regs */
+                                               if (next->dreg == ainfo->reg || 
next->dreg == AMD64_RAX)
+                                                       match = TRUE;
                                        }
                                        break;
                                }

_______________________________________________
Mono-patches maillist  -  Mono-patches@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to