From cc95d88ab3976235784c7a5a997f40e5684cf977 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Mon, 20 Feb 2023 16:54:20 +0100 Subject: [PATCH 1/3] Enable dedup on ioslike platforms --- src/mono/mono/mini/aot-compiler.c | 3 +-- src/mono/mono/mini/aot-runtime.c | 8 -------- src/mono/msbuild/apple/build/AppleApp.props | 2 +- 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/src/mono/mono/mini/aot-compiler.c b/src/mono/mono/mini/aot-compiler.c index 605cec84cde5d8..88a4218d1a6d58 100644 --- a/src/mono/mono/mini/aot-compiler.c +++ b/src/mono/mono/mini/aot-compiler.c @@ -14896,8 +14896,7 @@ aot_assembly (MonoAssembly *ass, guint32 jit_opts, MonoAotOptions *aot_options) acfg->stats.jit_time = GINT64_TO_INT (TV_ELAPSED (atv, btv)); // Current implementation uses dedup_methods hash table for storing extra methods which are emitted in a dedup AOT image. // Previously, cfg->skip flag in dedup_skip_methods is used for indicating if a method should be emitted in an AOT image. - // Method dedup_skip_methods is used only for wasm. -#ifdef TARGET_WASM +#ifdef 0 dedup_skip_methods (acfg); #endif if (acfg->dedup_collect_only) { diff --git a/src/mono/mono/mini/aot-runtime.c b/src/mono/mono/mini/aot-runtime.c index f25c1f2d4485dc..683fee00852e75 100644 --- a/src/mono/mono/mini/aot-runtime.c +++ b/src/mono/mono/mini/aot-runtime.c @@ -4492,8 +4492,6 @@ inst_is_private (MonoGenericInst *inst) gboolean mono_aot_can_dedup (MonoMethod *method) { - // Dedup enabled for wasm and iOS -#if defined(TARGET_WASM) || defined(TARGET_IOS) /* Use a set of wrappers/instances which work and useful */ switch (method->wrapper_type) { case MONO_WRAPPER_RUNTIME_INVOKE: @@ -4541,12 +4539,6 @@ mono_aot_can_dedup (MonoMethod *method) return TRUE; } return FALSE; -#else - gboolean not_normal_gshared = method->is_inflated && !mono_method_is_generic_sharable_full (method, TRUE, FALSE, FALSE); - gboolean extra_method = (method->wrapper_type != MONO_WRAPPER_NONE) || not_normal_gshared; - - return extra_method; -#endif } diff --git a/src/mono/msbuild/apple/build/AppleApp.props b/src/mono/msbuild/apple/build/AppleApp.props index 14045c53611f8e..b86e481943d732 100644 --- a/src/mono/msbuild/apple/build/AppleApp.props +++ b/src/mono/msbuild/apple/build/AppleApp.props @@ -2,7 +2,7 @@ true - true + true From 6f642a4c2bdf41d1d6c0f1cfacdb8baaa9f89e6b Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Mon, 20 Feb 2023 17:18:47 +0100 Subject: [PATCH 2/3] Fix directive --- src/mono/mono/mini/aot-compiler.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/mono/mini/aot-compiler.c b/src/mono/mono/mini/aot-compiler.c index 88a4218d1a6d58..541db6730660e0 100644 --- a/src/mono/mono/mini/aot-compiler.c +++ b/src/mono/mono/mini/aot-compiler.c @@ -14896,7 +14896,7 @@ aot_assembly (MonoAssembly *ass, guint32 jit_opts, MonoAotOptions *aot_options) acfg->stats.jit_time = GINT64_TO_INT (TV_ELAPSED (atv, btv)); // Current implementation uses dedup_methods hash table for storing extra methods which are emitted in a dedup AOT image. // Previously, cfg->skip flag in dedup_skip_methods is used for indicating if a method should be emitted in an AOT image. -#ifdef 0 +#if 0 dedup_skip_methods (acfg); #endif if (acfg->dedup_collect_only) { From ed0cb4356ca9dade7d8f42508da7a2f3e4ff1fd9 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Wed, 22 Feb 2023 10:48:26 +0100 Subject: [PATCH 3/3] Remove dedup_skip_methods method --- src/mono/mono/mini/aot-compiler.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/mono/mono/mini/aot-compiler.c b/src/mono/mono/mini/aot-compiler.c index 541db6730660e0..ba5a366832145b 100644 --- a/src/mono/mono/mini/aot-compiler.c +++ b/src/mono/mono/mini/aot-compiler.c @@ -14894,11 +14894,6 @@ aot_assembly (MonoAssembly *ass, guint32 jit_opts, MonoAotOptions *aot_options) TV_GETTIME (btv); acfg->stats.jit_time = GINT64_TO_INT (TV_ELAPSED (atv, btv)); - // Current implementation uses dedup_methods hash table for storing extra methods which are emitted in a dedup AOT image. - // Previously, cfg->skip flag in dedup_skip_methods is used for indicating if a method should be emitted in an AOT image. -#if 0 - dedup_skip_methods (acfg); -#endif if (acfg->dedup_collect_only) { /* We only collected methods from this assembly */ acfg_free (acfg);