Could you also make some videos about the differences in output on different operating systems? It seems like on Linux / Mac even the MS version of dotnet (the dotnet/runtime) essentially uses the merged in Mono under the hood. As a result a lot of code output and performance characteristics work completely differently to what happens in the WIndows world.
also, I took a look at the MSIL and I was surprised that the loop cloning happens at the IL -> ASM level and not at the C# -> IL level. Wonder what's the design decision behind that, possibly to keep the compiler simple.
Since Loop Cloning is Idiom based it's done in the lowest level possible to be efficient and possibly in the future capture many loop patterns (currently it's very limited).
@@LevelUppp what is Idiom based? Also, I took a quick look through the repo, looks like loop cloning is defined here: github.com/dotnet/runtime/blob/master/src/coreclr/src/jit/optimizer.cpp#L4526 Don't have time to look through it today, but just posting here to remind myself
@@thomastay4228 It's a fancy way of saying that compilers detect certain patterns in IL/IR code and then transform that code into a more optimal representation.