Aleksey Kliger (λgeek)

Results 127 comments of Aleksey Kliger (λgeek)

To repro: ``` ./build.sh --os browser -c Release ./dotnet.sh build /t:Test /p:TargetOS=Browser /p:TargetArchitecture=Wasm /p:RunAOTCompilation=true /p:EnableAggressiveTrimming=true -c Release src/libraries/System.Runtime/tests ``` --- *Update* make sure to undo https://github.com/dotnet/runtime/commit/7d19e1343b2ac2bdfc46f7c1d046e9547e126f5f

Here's the IL from the publish folder (so presumably after trimming) // method line 5714 .method public static hidebysig default int32 IndexOfAny (unsigned int8& A_0, unsigned int8 A_1, unsigned int8...

It's the last IL instruction: ``` IL_02a5: brfalse IL_01bb ``` the problematic case (thank you good backtrace) is here: https://github.com/dotnet/runtime/blob/916f1ad5b391764e964b271f80b915869e1afed0/src/mono/mono/mini/method-to-ir.c#L8458-L8459 So we want to create a basic block for the...

Took a while to find the untrimmed IL (it's in `artifacts/obj/mono/System.Private.CoreLib/wasm/Release/PreTrim/System.Private.CoreLib.dll`). https://gist.github.com/lambdageek/926024d4afcc5f0d07167f80e8350af9 so it's not something that the c# compiler produced originally

Arguably this code is "fine" - at runtime it will always take the branch. ``` IL_02a4: ldc.i4.0 IL_02a5: brfalse IL_01bb } // end of method SpanHelpers::IndexOfAny ``` And we could...

@marek-safar @vitek-karas Is it reasonable to expect the linker not to make branches like this?

@naricc when this is merged, please open issues for xamarin-macios and xamarin-android to make sure they include the marshal-ilgen component by default. /cc @jonathanpeppers @rolfbjarne

> We'll also need to know what MSBuild property toggles the inclusion of this component. We have these basically hardcoded right now: > > https://github.com/xamarin/xamarin-android/blob/73f10df63b00ee8a21d61183056a26922c83e89d/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.AssemblyResolution.targets#L198-L200 @jonathanpeppers @naricc There are going...

@naricc please open issues for XA and XI to add the component by default!