Skip to content

AX backend restructure for LLVM opaque ptr support (LLVM 16+)#2065

Merged
Idclip merged 1 commit intoAcademySoftwareFoundation:masterfrom
Idclip:ax_backend_upgrade
Aug 3, 2025
Merged

AX backend restructure for LLVM opaque ptr support (LLVM 16+)#2065
Idclip merged 1 commit intoAcademySoftwareFoundation:masterfrom
Idclip:ax_backend_upgrade

Conversation

@Idclip
Copy link
Copy Markdown
Contributor

@Idclip Idclip commented Jul 27, 2025

OpenVDB AX:
 - Improvements:
   - Added support for LLVM versions greater than 15. Upgraded CI to test with
     LLVM versions 16, 17, 18, 19 and 20.
   - As of this release, LLVM 15 is the minimum required version for OpenVDB AX.
     Note that there is an issue with LLVM 17 symbols which makes it incompatible
     with the OpenVDB Python plugin. AS such, LLVM version 18 and greater are
     the recommended LLVM versions to use, with LLVM 18 being the new future
     minimum version.
   - Significant performance improvement to the compilation of AX kernels when
     using LLVM 18 and greater.
   - Significant backend refactoring to AX IR generation to support newer 
     versions of LLVM. In particular, parts of the codegen::Function and 
     codegen::FunctionBuilder API require new usage from LLVM 16 due to
     the LLVM opaque pointer changes. If you're not using the OpenVDB AX
     Function codegen API then no client changes should be necessary.

 - Fixes:
  - Fixed a case of undefined behaviour when explicitly casting variables to
    the same type as their storage type e.g:
      double a; double b = double(a);
  - Fixed an AX compiler error which would produce invalid IR when using 64bit
    integer variables for matrix array offsetting e.g:
       int64 a = 0; mat4f b = 1; float c = b[a,a];

@Idclip Idclip linked an issue Jul 28, 2025 that may be closed by this pull request
@Idclip Idclip force-pushed the ax_backend_upgrade branch from 1e538dc to 642af2c Compare July 28, 2025 06:26
Signed-off-by: Nicholas Avramoussis <navramoussis@wetafx.co.nz>
@Idclip Idclip force-pushed the ax_backend_upgrade branch from 642af2c to 286a197 Compare July 28, 2025 06:54
@Idclip Idclip marked this pull request as ready for review July 28, 2025 08:15
Copy link
Copy Markdown
Contributor

@jmlait jmlait left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Impressive to have to maintain the various flavours of LLVM in one build, I do not envy the changes required.

@Idclip
Copy link
Copy Markdown
Contributor Author

Idclip commented Jul 31, 2025

Impressive to have to maintain the various flavours of LLVM in one build, I do not envy the changes required.

This was extremely painful, but it's somewhat on me for relying too heavily on LLVM's IR and not having our own - I've made steps in that direction in this MR. The opaque ptr changes were the only significant issue, primarily in the backend function framework which was handling resolution - without being able to introspect pointer types this all fell apart. Once this was solved it was minor API discrepancies between LLVM 16->20 (with a symbol issue in LLVM 17, hence the new future minimum of LLVM 18 and the new absolute minimum of LLVM 15).

@Idclip Idclip merged commit 8348da2 into AcademySoftwareFoundation:master Aug 3, 2025
43 checks passed
@Idclip Idclip deleted the ax_backend_upgrade branch August 3, 2025 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUILD] OpenVDB fails to build with LLVM 18

2 participants