Skip to content

LLVM IR code generator refactoring and updates - #8140

Merged
grendello merged 33 commits into
dotnet:mainfrom
grendello:llvm-generator-update
Jul 17, 2023
Merged

LLVM IR code generator refactoring and updates#8140
grendello merged 33 commits into
dotnet:mainfrom
grendello:llvm-generator-update

Conversation

@grendello

@grendellogrendello commented Jun 21, 2023

Copy link
Copy Markdown
Contributor

Context: https://llvm.org/docs/OpaquePointers.html

  • Migrate to opaque pointers (LLVM 15+) which will be the only ones
    supported from LLVM 16 onwards. This will allow us to update our
    toolchain to LLVM 16 or newer at some point. It also simplifies
    both the code generator and the generated code.
  • Change code generation model. Now the "client" classes don't need
    to concern themselves with how the LLVM IR code looks and how
    it is formatted. Instead, they build a model of the code they want
    to output and let the generator do the rest.
  • Handle many more tasks automatically:
    • LLVM IR string management and registration
    • Buffer management for structures which have pointers to buffers
    • References to local variables and strings
    • Local temporary counting (unnamed labels and function parameters).
      LLVM requires that all unnamed local temporaries (that is labels and
      function parameters) are named using a shared counter, with all of thus
      generated names being numbers in sequence. In the previous version of
      the generator it was problematic, in this version it's easy and seamless.

 * Migrate to opaque pointers (LLVM 15+) which will be the only ones
supported from LLVM 16 onwards
* Change code generation model. Now the "client" classes don't need
to concern themselves with **how** the LLVM IR code looks and how
it is formatted. Instead, they build a model of the code they want
to output and let the generator do the rest.
* Handle many more tasks automatically:
* LLVM IR string management and registration
* Buffer management for structures which have pointers to buffers
* References to local variables and strings
* Local temporary counting (unnamed labels and function parameters)
* main:
[tests] Remove `XASdkDeployTests` (dotnet#8139)
LLVM IR we use now generates slightly different native assembler code
* main:
Bump to google/bundletool@f17ce94a (dotnet#8135)
[Xamarin.Android.Build.Tasks] Handle IOException in Aapt2Daemon (dotnet#8130)
[tests] don't set `/uses-sdk@android:targetSdkVersion=34` by default (dotnet#8138)
* main:
$(AndroidPackVersionSuffix)=preview.7; net8 is 34.0.0-preview.7 (dotnet#8149)
[Mono.Android] Bind and enumify API-34 (dotnet#8116)
Apps segfault at startup when AOT is enabled, and yet typemaps appear to
be indentical... Investigation TBC tomorrow
* main:
[xaprepare] update Debian dependencies for current unstable (trixie) (dotnet#8169)
* main:
Bump to dotnet/installer@28d4a6b4be 8.0.100-preview.7.23330.16 (dotnet#8162)
[Xamarin.Android.Build.Tasks] Move MonoAndroidAssetsDirIntermediate (dotnet#8166)
[xaprepare] update Debian dependencies for current unstable (trixie) (dotnet#8169)
[CI] Use dotnet test slicer in nightly tests (dotnet#8154)
[Xamarin.Android.Build.Tasks] MarshalMethodsAssemblyRewriter+new file (dotnet#8151)
Bump to dotnet/installer@d2a244f560 8.0.100-preview.7.23325.5 (dotnet#8142)
* typemap-per-rid-support:
More test fixes
Fix test failures
New typemap scanner, disable marshal methods by default
Something isn't right...
Typemaps generated properly, testing and marshal methods tomorrow
Beginning to fix typemaps for per-abi assemblies
* main:
Bump to dotnet/installer@28d4a6b4be 8.0.100-preview.7.23330.16 (dotnet#8162)
[Xamarin.Android.Build.Tasks] Move MonoAndroidAssetsDirIntermediate (dotnet#8166)
@grendellogrendello added the do-not-merge PR should not be merged. label Jul 6, 2023
* main:
Bump external/Java.Interop from `738de61` to `e1121ea` (dotnet#8132)
* typemap-per-rid-support:
Remove debug stuff
Let's see if using the resolver directly helps
More printfs
Add some timing debug prints
Bump external/Java.Interop from `738de61` to `e1121ea` (dotnet#8132)
* typemap-per-rid-support:
Use a custom assembly resolver
* main:
[Xamarin.Android.Build.Tasks] per-RID assemblies & typemaps (dotnet#8164)
[AndroidDependenciesTests] Test both manifest types (dotnet#8186)
[AndroidDependenciesTests] Use platform-tools 34.0.4 (dotnet#8184)
* main:
[ci] XA.PublishAllLogs publishes all build logs to build artifacts (dotnet#8189)
Bump to xamarin/Java.Interop/main@151b03e (dotnet#8188)
[Mono.Android] Use PublicApiAnalyzers to ensure we do not break API. (dotnet#8171)
@grendellogrendello removed the do-not-merge PR should not be merged. label Jul 14, 2023
@grendello
grendello merged commit fc944ee into dotnet:mainJul 17, 2023
@grendello
grendello deleted the llvm-generator-update branch July 17, 2023 13:52
grendello added a commit to grendello/xamarin-android that referenced this pull request Jul 17, 2023
* main:
LLVM IR code generator refactoring and updates (dotnet#8140)
grendello added a commit to grendello/xamarin-android that referenced this pull request Jul 17, 2023
* main:
LLVM IR code generator refactoring and updates (dotnet#8140)
[ci] XA.PublishAllLogs publishes all build logs to build artifacts (dotnet#8189)
Bump to xamarin/Java.Interop/main@151b03e (dotnet#8188)
[Mono.Android] Use PublicApiAnalyzers to ensure we do not break API. (dotnet#8171)
[Xamarin.Android.Build.Tasks] per-RID assemblies & typemaps (dotnet#8164)
[AndroidDependenciesTests] Test both manifest types (dotnet#8186)
[AndroidDependenciesTests] Use platform-tools 34.0.4 (dotnet#8184)
grendello added a commit to grendello/xamarin-android that referenced this pull request Jul 17, 2023
* main:
LLVM IR code generator refactoring and updates (dotnet#8140)
@github-actionsgithub-actionsBot locked and limited conversation to collaborators Jan 22, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@grendello@dellis1972