dotnet / runtimelab

This repo is for experimentation and exploring new ideas that may or may not make it into the main dotnet/runtime repo.
MIT License
1.41k stars 197 forks source link

[NativeAOT-LLVM] Resolve some warnings, replace some `std` types with Jit types #2562

Closed SingleAccretion closed 5 months ago

SingleAccretion commented 5 months ago

The first commit fixes #2554.

The following few commits replace the usage of various std types, mostly std::vector with their JIT equivalents. This is for a couple reasons: 1) Jit types plug into the Jit allocator, which is both much faster and integrated into the Jit's memory usage diagnostics (CMK_XYZ). 2) We cannot really use the standard collections (see https://github.com/dotnet/runtime/pull/101088). 3) Consistency with the rest of the Jit.

The totality of the changes are zero-diff, except for the last commit, where I switched to jitstd::sort and some diffs were expected.

I will note that with regards to 2, we are still not functionally correct, since LLVM code (and some of our own code) may still call standard library functions which may throw. The primary concern is OOM, since, fortunately, LLVM itself doesn't use exceptions, and there are a couple solutions which could be employed. Luckily, this is not a problem that needs to be solved here and now.

SingleAccretion commented 5 months ago

@dotnet/nativeaot-llvm