From 4c61973f17ff83f3ef87ce414c4b45da78f2d7d3 Mon Sep 17 00:00:00 2001 From: Ivan Povazan Date: Tue, 19 Jul 2022 12:50:45 +0200 Subject: [PATCH 1/8] Testing mono llvmfullaot with interpreter as a fallback instead of GSHAREDVTs --- src/mono/mono/mini/aot-compiler.c | 5 +++-- src/tests/Common/testenvironment.proj | 2 +- src/tests/build.proj | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/mono/mono/mini/aot-compiler.c b/src/mono/mono/mini/aot-compiler.c index 107507498be330..629d716e107c1f 100644 --- a/src/mono/mono/mini/aot-compiler.c +++ b/src/mono/mono/mini/aot-compiler.c @@ -14360,8 +14360,9 @@ mono_compile_assembly (MonoAssembly *ass, guint32 opts, const char *aot_options, if (acfg->aot_opts.llvm_only) { if (!mono_aot_mode_is_interp (&acfg->aot_opts)) acfg->jit_opts |= MONO_OPT_GSHAREDVT; - } else if (mono_aot_mode_is_full (&acfg->aot_opts) || mono_aot_mode_is_hybrid (&acfg->aot_opts)) - acfg->jit_opts |= MONO_OPT_GSHAREDVT; + } else if (mono_aot_mode_is_full (&acfg->aot_opts) || mono_aot_mode_is_hybrid (&acfg->aot_opts)) { + // acfg->jit_opts |= MONO_OPT_GSHAREDVT; + } #endif #if !defined(ENABLE_LLVM) diff --git a/src/tests/Common/testenvironment.proj b/src/tests/Common/testenvironment.proj index 85fa1cd07e4f77..7a74e4b6799883 100644 --- a/src/tests/Common/testenvironment.proj +++ b/src/tests/Common/testenvironment.proj @@ -297,7 +297,7 @@ <_TestEnvFileLine Condition="'$(RuntimeVariant)' == 'llvmaot'" Include="export MONO_ENV_OPTIONS=--llvm" /> - <_TestEnvFileLine Condition="'$(RuntimeVariant)' == 'llvmfullaot'" Include="export MONO_ENV_OPTIONS=--full-aot" /> + <_TestEnvFileLine Condition="'$(RuntimeVariant)' == 'llvmfullaot'" Include="export MONO_ENV_OPTIONS=--full-aot-interp" /> <_TestEnvFileLine Condition="'$(Scenario)' == 'clrinterpreter'" Include="export COMPlus_Interpret=%2A" /> diff --git a/src/tests/build.proj b/src/tests/build.proj index 37236bad27175f..84b49922a9c6ce 100644 --- a/src/tests/build.proj +++ b/src/tests/build.proj @@ -128,6 +128,7 @@ + From 82532517b4b05052a4218a87726bc6b9fcb2c701 Mon Sep 17 00:00:00 2001 From: Ivan Povazan Date: Mon, 1 Aug 2022 21:29:30 +0200 Subject: [PATCH 2/8] Relaxing the assert when original type and cmods_source are alias but come from different assemblies --- src/mono/mono/metadata/metadata.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/mono/metadata/metadata.c b/src/mono/mono/metadata/metadata.c index 690df1e8157398..536b8e98ddfde7 100644 --- a/src/mono/mono/metadata/metadata.c +++ b/src/mono/mono/metadata/metadata.c @@ -6085,7 +6085,7 @@ mono_metadata_type_dup_with_cmods (MonoImage *image, const MonoType *o, const Mo if (cmods_source->has_cmods) { /* FIXME: if it's aggregate what do we assert here? */ - g_assert (!image || (!aggregate && image == mono_type_get_cmods (cmods_source)->image)); + g_assert (!image || (o == cmods_source) || (!aggregate && image == mono_type_get_cmods (cmods_source)->image)); memcpy (r, cmods_source, mono_sizeof_type (cmods_source)); } From a03d78d180ba0fd6fa15d421e900057028b3d019 Mon Sep 17 00:00:00 2001 From: Ivan Povazan Date: Tue, 2 Aug 2022 16:12:10 +0200 Subject: [PATCH 3/8] Do not initialize interpreted callback when initializing delegates in fullaot+interp mode --- src/mono/mono/mini/mini-runtime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/mono/mini/mini-runtime.c b/src/mono/mono/mini/mini-runtime.c index 5aa0502bc0800e..f9c83b26332ab7 100644 --- a/src/mono/mono/mini/mini-runtime.c +++ b/src/mono/mono/mini/mini-runtime.c @@ -3950,7 +3950,7 @@ mini_init_delegate (MonoDelegateHandle delegate, MonoObjectHandle target, gpoint MonoDelegateTrampInfo *info = NULL; - if (mono_use_interpreter) { + if (mono_use_interpreter && !mono_aot_only) { mini_get_interp_callbacks ()->init_delegate (del, &info, error); return_if_nok (error); } From 01392f57f7854652b2b4b54d7366fcf4a78c0855 Mon Sep 17 00:00:00 2001 From: Ivan Povazan Date: Wed, 3 Aug 2022 15:45:54 +0200 Subject: [PATCH 4/8] FullAOT mode forces generation of gsharedvts by force applying the flag to jit options. Exclude this in case interpreter was enabled in fullAOT mode --- src/mono/mono/mini/aot-compiler.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mono/mono/mini/aot-compiler.c b/src/mono/mono/mini/aot-compiler.c index 629d716e107c1f..1e6a01f2ff8c2f 100644 --- a/src/mono/mono/mini/aot-compiler.c +++ b/src/mono/mono/mini/aot-compiler.c @@ -14360,8 +14360,8 @@ mono_compile_assembly (MonoAssembly *ass, guint32 opts, const char *aot_options, if (acfg->aot_opts.llvm_only) { if (!mono_aot_mode_is_interp (&acfg->aot_opts)) acfg->jit_opts |= MONO_OPT_GSHAREDVT; - } else if (mono_aot_mode_is_full (&acfg->aot_opts) || mono_aot_mode_is_hybrid (&acfg->aot_opts)) { - // acfg->jit_opts |= MONO_OPT_GSHAREDVT; + } else if ((mono_aot_mode_is_full (&acfg->aot_opts) && !acfg->aot_opts.interp) || mono_aot_mode_is_hybrid (&acfg->aot_opts)) { + acfg->jit_opts |= MONO_OPT_GSHAREDVT; } #endif From e123f83feded4cddfcfef61cbdbdce651ae16a30 Mon Sep 17 00:00:00 2001 From: Ivan Povazan Date: Wed, 10 Aug 2022 16:29:00 +0200 Subject: [PATCH 5/8] Adding comments for why the testing environment has been temporary altered --- src/tests/Common/testenvironment.proj | 1 + src/tests/build.proj | 1 + 2 files changed, 2 insertions(+) diff --git a/src/tests/Common/testenvironment.proj b/src/tests/Common/testenvironment.proj index 7a74e4b6799883..0ce839577b4a2d 100644 --- a/src/tests/Common/testenvironment.proj +++ b/src/tests/Common/testenvironment.proj @@ -297,6 +297,7 @@ <_TestEnvFileLine Condition="'$(RuntimeVariant)' == 'llvmaot'" Include="export MONO_ENV_OPTIONS=--llvm" /> + <_TestEnvFileLine Condition="'$(RuntimeVariant)' == 'llvmfullaot'" Include="export MONO_ENV_OPTIONS=--full-aot-interp" /> diff --git a/src/tests/build.proj b/src/tests/build.proj index 84b49922a9c6ce..1877f07248b0de 100644 --- a/src/tests/build.proj +++ b/src/tests/build.proj @@ -128,6 +128,7 @@ + From d5bfdf7d2a6bb932f4130ad29e47ca6a788a01ce Mon Sep 17 00:00:00 2001 From: Ivan Povazan Date: Thu, 11 Aug 2022 13:52:27 +0200 Subject: [PATCH 6/8] Attempt to fix a regression on apple lanes --- src/mono/mono/mini/mini-runtime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/mono/mini/mini-runtime.c b/src/mono/mono/mini/mini-runtime.c index f9c83b26332ab7..5aa0502bc0800e 100644 --- a/src/mono/mono/mini/mini-runtime.c +++ b/src/mono/mono/mini/mini-runtime.c @@ -3950,7 +3950,7 @@ mini_init_delegate (MonoDelegateHandle delegate, MonoObjectHandle target, gpoint MonoDelegateTrampInfo *info = NULL; - if (mono_use_interpreter && !mono_aot_only) { + if (mono_use_interpreter) { mini_get_interp_callbacks ()->init_delegate (del, &info, error); return_if_nok (error); } From 0ca3eea1081100485bd94a8170b1ddf446528a8e Mon Sep 17 00:00:00 2001 From: Ivan Povazan Date: Fri, 12 Aug 2022 15:00:58 +0200 Subject: [PATCH 7/8] [FIXME] workaround to pass build on apple lanes --- src/libraries/tests.proj | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index 1defbf332910a6..9facfb3154a74d 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -341,6 +341,9 @@ + + + From 5e8624a8195d35bc3671cd5c520d033143865a9c Mon Sep 17 00:00:00 2001 From: Ivan Povazan Date: Wed, 7 Sep 2022 15:47:23 +0200 Subject: [PATCH 8/8] Revert "[FIXME] workaround to pass build on apple lanes" This reverts commit fce6db05658275139e17af2d5624f76a19c5b63d. --- src/libraries/tests.proj | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index 9facfb3154a74d..1defbf332910a6 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -341,9 +341,6 @@ - - -