[mono][llvm] Improve LLVM 9 compatibility. (#34182)
authorimhameed <imhameed@microsoft.com>
Mon, 30 Mar 2020 21:01:25 +0000 (14:01 -0700)
committerGitHub <noreply@github.com>
Mon, 30 Mar 2020 21:01:25 +0000 (14:01 -0700)
commit335ffb05fbe97187452046bc6791405ea33f210c
tree40968edf21407255ad0e0ff966f84eaa2e3776f7
parentc3f7da2008a4c7508fac1c4ff4722ca85a2214fe
[mono][llvm] Improve LLVM 9 compatibility. (#34182)

Improve LLVM 9 compatibility.

Several intrinsics were removed in LLVM 7 and above; replace them with
IR sequences that generate the desired instructions.

Fix some type mismatch problems with the generated IR (in
Sse2.StoreAlignedNonTemporal, Vector128.CreateScalarUnsafe, and
Sse2.MaskMove); these were caught by running the coreclr hardware
intrinsic JIT tests.

Support the two-argument forms of Sse.SqrtScalar, Sse.ReciprocalScalar,
and Sse.ReciprocalSqrtScalar.

llvm::linkCoreCLRGC(), in llvm/CodeGen/GCs.h, was removed and replaced with
llvm::linkAllBuiltinGCs(), in llvm/CodeGen/BuiltinGCs.h.

In mono_llvm_dump_value and mono_llvm_dump_module, flush the c library's
stdout stream before using (and flushing) LLVM's own buffered output
functions.
src/mono/mono/mini/llvm-intrinsics.h
src/mono/mono/mini/llvm-jit.cpp
src/mono/mono/mini/mini-llvm-cpp.cpp
src/mono/mono/mini/mini-llvm.c
src/mono/mono/mini/mini-ops.h
src/mono/mono/mini/mini.h
src/mono/mono/mini/simd-intrinsics-netcore.c