Author: zoltan
Date: 2007-12-14 16:05:07 -0500 (Fri, 14 Dec 2007)
New Revision: 91329
Modified:
branches/vargaz/mini-linear-il/mono/mono/mini/ChangeLog
branches/vargaz/mini-linear-il/mono/mono/mini/method-to-ir.c
branches/vargaz/mini-linear-il/mono/mono/mini/mini.c
branches/vargaz/mini-linear-il/mono/mono/mini/mini.h
Log:
2007-12-14 Zoltan Varga <[EMAIL PROTECTED]>
* mini.h (MonoInst): Reorder members so frequently used members come
first.
* method-to-ir.c mini.c: Add flags to MonoCompile and MonoBasicBlock so
the
decompose_array_access_opts () pass is only run when needed.
Modified: branches/vargaz/mini-linear-il/mono/mono/mini/ChangeLog
===================================================================
--- branches/vargaz/mini-linear-il/mono/mono/mini/ChangeLog 2007-12-14
20:37:37 UTC (rev 91328)
+++ branches/vargaz/mini-linear-il/mono/mono/mini/ChangeLog 2007-12-14
21:05:07 UTC (rev 91329)
@@ -1,5 +1,10 @@
2007-12-14 Zoltan Varga <[EMAIL PROTECTED]>
+ * mini.h (MonoInst): Reorder members so frequently used members come
first.
+
+ * method-to-ir.c mini.c: Add flags to MonoCompile and MonoBasicBlock so
the
+ decompose_array_access_opts () pass is only run when needed.
+
* method-to-ir.c (mono_handle_global_vregs): Disable some code which
slows down
compilation too much.
Modified: branches/vargaz/mini-linear-il/mono/mono/mini/method-to-ir.c
===================================================================
--- branches/vargaz/mini-linear-il/mono/mono/mini/method-to-ir.c
2007-12-14 20:37:37 UTC (rev 91328)
+++ branches/vargaz/mini-linear-il/mono/mono/mini/method-to-ir.c
2007-12-14 21:05:07 UTC (rev 91329)
@@ -149,7 +149,7 @@
#define MONO_INIT_VARINFO(vi,id) do { \
(vi)->range.first_use.pos.bid = 0xffff; \
(vi)->reg = -1; \
- (vi)->idx = (id); \
+ (vi)->idx = (id); \
} while (0)
static inline guint32
@@ -361,6 +361,7 @@
(dest)->opcode = (op); \
(dest)->flags = 0; \
(dest)->dreg = (dest)->sreg1 = (dest)->sreg2 = -1; \
+ (dest)->cil_code = (cfg)->ip; \
} while (0)
/*
@@ -875,6 +876,8 @@
ins->sreg2 = index_reg; \
ins->inst_imm = G_STRUCT_OFFSET (array_type, array_length_field); \
MONO_ADD_INS ((cfg)->cbb, ins); \
+ (cfg)->flags |= MONO_CFG_HAS_ARRAY_ACCESS; \
+ (cfg)->cbb->has_array_access = TRUE; \
} while (0)
#if defined(__i386__)
@@ -5877,6 +5880,9 @@
MonoInst *iargs [3];
gboolean restart;
+ if (!bb->has_array_access)
+ continue;
+
if (cfg->verbose_level > 3) mono_print_bb (bb, "BEFORE
DECOMPOSE-ARRAY-ACCESS-OPTS ");
cfg->cbb->code = cfg->cbb->last_ins = NULL;
@@ -8297,7 +8303,6 @@
}
}
-
if (shared_access) {
MonoInst *rgctx;
MonoInst *args [3];
@@ -8333,7 +8338,9 @@
ins->inst_newa_class = klass;
ins->type = STACK_OBJ;
ins->klass = klass;
- MONO_ADD_INS (cfg->cbb, ins);
+ MONO_ADD_INS (cfg->cbb, ins);
+ cfg->flags |= MONO_CFG_HAS_ARRAY_ACCESS;
+ cfg->cbb->has_array_access = TRUE;
}
}
@@ -8378,6 +8385,8 @@
ins->sreg1 = sp [0]->dreg;
ins->type = STACK_I4;
MONO_ADD_INS (cfg->cbb, ins);
+ cfg->flags |= MONO_CFG_HAS_ARRAY_ACCESS;
+ cfg->cbb->has_array_access = TRUE;
ip ++;
*sp++ = ins;
break;
Modified: branches/vargaz/mini-linear-il/mono/mono/mini/mini.c
===================================================================
--- branches/vargaz/mini-linear-il/mono/mono/mini/mini.c 2007-12-14
20:37:37 UTC (rev 91328)
+++ branches/vargaz/mini-linear-il/mono/mono/mini/mini.c 2007-12-14
21:05:07 UTC (rev 91329)
@@ -10945,6 +10945,7 @@
bb->out_count = bbn->out_count;
bb->out_bb = bbn->out_bb;
+ bb->has_array_access |= bbn->has_array_access;
replace_basic_block (bb, bbn, bb);
@@ -12272,7 +12273,8 @@
if (cfg->new_ir) {
mono_decompose_vtype_opts (cfg);
- mono_decompose_array_access_opts (cfg);
+ if (cfg->flags & MONO_CFG_HAS_ARRAY_ACCESS)
+ mono_decompose_array_access_opts (cfg);
}
if (!cfg->new_ir) {
Modified: branches/vargaz/mini-linear-il/mono/mono/mini/mini.h
===================================================================
--- branches/vargaz/mini-linear-il/mono/mono/mini/mini.h 2007-12-14
20:37:37 UTC (rev 91328)
+++ branches/vargaz/mini-linear-il/mono/mono/mini/mini.h 2007-12-14
21:05:07 UTC (rev 91329)
@@ -266,7 +266,9 @@
guint out_of_line : 1;
/* Caches the result of uselessness calculation during
optimize_branches */
guint not_useless : 1;
-
+ /* Whenever the decompose_array_access_opts () pass needs to process
this bblock */
+ guint has_array_access : 1;
+
/* use for liveness analysis */
MonoBitSet *gen_set;
MonoBitSet *kill_set;
@@ -315,6 +317,16 @@
} MonoMemcpyArgs;
struct MonoInst {
+ guint16 opcode;
+ guint8 type; /* stack type */
+ guint ssa_op : 3;
+ guint8 flags : 5;
+
+ /* used by the register allocator */
+ gint32 dreg, sreg1, sreg2;
+
+ MonoInst *next;
+
union {
union {
MonoInst *src;
@@ -334,13 +346,9 @@
gint64 i8const;
double r8const;
} data;
- guint16 opcode;
- guint8 type; /* stack type */
- guint ssa_op : 3;
- guint8 flags : 5;
-
- /* used by the register allocator */
- gint32 dreg, sreg1, sreg2;
+
+ const unsigned char* cil_code; /* for debugging and bblock splitting */
+
/* used mostly by the backend to store additional info it may need */
union {
gint32 reg3;
@@ -351,9 +359,7 @@
gboolean is_pinvoke; /* for variables in the unmanaged marshal
format */
} backend;
- MonoInst *next;
MonoClass *klass;
- const unsigned char* cil_code; /* for debugging and bblock splitting */
};
struct MonoCallInst {
@@ -721,6 +727,7 @@
MONO_CFG_HAS_FPOUT = 1 << 5, /* there are fp values passed in int
registers */
MONO_CFG_HAS_SPILLUP = 1 << 6, /* spill var slots are allocated from
bottom to top */
MONO_CFG_HAS_CHECK_THIS = 1 << 7,
+ MONO_CFG_HAS_ARRAY_ACCESS = 1 << 8
} MonoCompileFlags;
typedef struct {
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches