Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LLVM IR code generator refactoring and updates #8140

Merged
merged 33 commits into from
Jul 17, 2023

Conversation

grendello
Copy link
Contributor

@grendello grendello commented Jun 21, 2023

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)
@grendello grendello 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)
@grendello grendello removed the do-not-merge PR should not be merged. label Jul 14, 2023
@grendello grendello merged commit fc944ee into dotnet:main Jul 17, 2023
48 checks passed
@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-actions github-actions bot locked and limited conversation to collaborators Jan 22, 2024
Sign up for free to 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