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

Support LLVM 14 (upstream Git main) #43628

Merged
merged 1 commit into from
Jan 5, 2022

Conversation

dnadlinger
Copy link
Member

@dnadlinger dnadlinger commented Jan 1, 2022

Compiles against llvm/llvm-project@2ec3ca747732, with some of our unmerged local patches from 13.x still required to fix some miscompilations, etc.

Unfortunately, there is quite a bit of fallout from the various attribute API renames. I chose to introduce some function shims to separate out all the preprocessor #if clutter.

Some small refactorings were also necessary as some LLVM APIs now explicitly require the pointer element type in preparation for opaque pointers.


There should be no functional changes on older versions; compilation checked against the BinaryBuilder LLVM 12 that the Makefiles pull in by default.

I ported Julia to LLVM main for my work on darwin-aarch64, but even if we might end up back-porting all the components required for that, @vchuravy mentioned on Slack that having main support in the main repository would still be interesting.

Compiles against llvm/llvm-project#2ec3ca747732, with some of
our unmerged local patches from 13.x still required.

Unfortunately, there is quite a bit of fallout from the various
attribute API renames. I chose to introduce some function shims
to separate out all the preprocessor #if clutter.
@vchuravy vchuravy added compiler:codegen Generation of LLVM IR and native code merge me PR is reviewed. Merge when all tests are passing labels Jan 3, 2022
@DilumAluthge DilumAluthge merged commit 144ebba into JuliaLang:master Jan 5, 2022
@DilumAluthge DilumAluthge removed the merge me PR is reviewed. Merge when all tests are passing label Jan 5, 2022
@dnadlinger dnadlinger deleted the llvm-14 branch January 5, 2022 02:46
@dnadlinger
Copy link
Member Author

Thanks for the speedy review!

@@ -1951,7 +1947,7 @@ jl_cgval_t function_sig_t::emit_a_ccall(
// something alloca'd above is SSA
if (static_rt)
return mark_julia_slot(result, rt, NULL, tbaa_stack);
result = ctx.builder.CreateLoad(result);
result = ctx.builder.CreateLoad(cast<PointerType>(result->getType())->getElementType(), result);
Copy link
Member

Choose a reason for hiding this comment

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

getElementType is deprecated and must not be used in new code

Copy link
Member Author

Choose a reason for hiding this comment

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

This would require some restructuring of emit_a_ccall – I'd rather leave this to somebody familiar with the code once getElementType is actually removed.

@dnadlinger
Copy link
Member Author

#43721 removes some of the getElementType instances from the codebase.

LilithHafner pushed a commit to LilithHafner/julia that referenced this pull request Feb 22, 2022
Compiles against llvm/llvm-project#2ec3ca747732, with some of
our unmerged local patches from 13.x still required.

Unfortunately, there is quite a bit of fallout from the various
attribute API renames. I chose to introduce some function shims
to separate out all the preprocessor #if clutter.
LilithHafner pushed a commit to LilithHafner/julia that referenced this pull request Mar 8, 2022
Compiles against llvm/llvm-project#2ec3ca747732, with some of
our unmerged local patches from 13.x still required.

Unfortunately, there is quite a bit of fallout from the various
attribute API renames. I chose to introduce some function shims
to separate out all the preprocessor #if clutter.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:codegen Generation of LLVM IR and native code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants