-/*
- * alias-analysis.c: Implement simple alias analysis for local variables.
+/**
+ * \file
+ * Implement simple alias analysis for local variables.
*
* Author:
* Rodrigo Kumpera (kumpera@gmail.com)
#include "mini.h"
#include "ir-emit.h"
#include "glib.h"
+#include <mono/utils/mono-compiler.h>
#ifndef DISABLE_JIT
for (ins = bb->code; ins; ins = ins->next) {
handle_instruction:
switch (ins->opcode) {
- case OP_LDADDR:
- g_hash_table_insert (addr_loads, GINT_TO_POINTER (ins->dreg), ins);
- if (cfg->verbose_level > 2) { printf ("New address: "); mono_print_ins (ins); }
+ case OP_LDADDR: {
+ MonoInst *var = (MonoInst*)ins->inst_p0;
+ if (var->flags & MONO_INST_VOLATILE) {
+ if (cfg->verbose_level > 2) { printf ("Found address to volatile var, can't take it: "); mono_print_ins (ins); }
+ } else {
+ g_hash_table_insert (addr_loads, GINT_TO_POINTER (ins->dreg), ins);
+ if (cfg->verbose_level > 2) { printf ("New address: "); mono_print_ins (ins); }
+ }
break;
+ }
+
case OP_MOVE:
tmp = (MonoInst*)g_hash_table_lookup (addr_loads, GINT_TO_POINTER (ins->sreg1));
/*
case OP_LOADU4_MEMBASE:
case OP_LOADI1_MEMBASE:
case OP_LOADI8_MEMBASE:
+#ifndef MONO_ARCH_SOFT_FLOAT_FALLBACK
case OP_LOADR4_MEMBASE:
+#endif
case OP_LOADR8_MEMBASE:
if (ins->inst_offset != 0)
continue;
case OP_STOREI2_MEMBASE_REG:
case OP_STOREI4_MEMBASE_REG:
case OP_STOREI8_MEMBASE_REG:
+#ifndef MONO_ARCH_SOFT_FLOAT_FALLBACK
case OP_STORER4_MEMBASE_REG:
+#endif
case OP_STORER8_MEMBASE_REG:
case OP_STOREV_MEMBASE:
if (ins->inst_offset != 0)
}
}
break;
-
+ //FIXME missing storei1_membase_imm and storei2_membase_imm
case OP_STORE_MEMBASE_IMM:
case OP_STOREI4_MEMBASE_IMM:
case OP_STOREI8_MEMBASE_IMM:
mono_print_code (cfg, "AFTER ALIAS_ANALYSIS");
}
+#else /* !DISABLE_JIT */
+
+MONO_EMPTY_SOURCE_FILE (alias_analysis);
+
#endif /* !DISABLE_JIT */