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 15 #13173

Merged
merged 10 commits into from
Mar 11, 2023
Merged

Conversation

HertzDevil
Copy link
Contributor

@HertzDevil HertzDevil commented Mar 9, 2023

It took us a long time, but here is the final PR for LLVM 15 support. Only the last two commits are unique to this PR, the rest are untouched from feature/llvm-opaque-pointers. Resolves #12743. Resolves #12484.

Some numbers copied from here:

Here are the stats of make clean crystal release=1, followed by 10 runs of make clean_cache && bin/crystal run --stats src/compiler/crystal.cr:

LLVM 14.0.1 (c6e3116) LLVM 14.0.1 (cfd9d60) LLVM 15.0.7 (cfd9d60)
Parse 0.0000s (±21.8%) 0.0000s (±17.3%) 0.0000s (±13.9%)
Semantic (top level) 0.4296s (±3.6%) 0.4528s (±9.0%) 0.4658s (±4.7%)
Semantic (new) 0.0018s (±2.6%) 0.0018s (±12.7%) 0.0019s (±17.5%)
Semantic (type declarations) 0.0308s (±3.2%) 0.0310s (±4.6%) 0.0329s (±16.9%)
Semantic (abstract def check) 0.0127s (±1.7%) 0.0131s (±3.0%) 0.0129s (±2.3%)
Semantic (restrictions augmenter) 0.0101s (±4.4%) 0.0101s (±8.9%) 0.0098s (±6.9%)
Semantic (ivars initializers) 4.5505s (±0.8%) 4.5354s (±0.7%) 6.0346s (±2.6%)
Semantic (cvars initializers) 0.0051s (±3.4%) 0.0053s (±9.4%) 0.0050s (±2.0%)
Semantic (main) 6.3904s (±1.9%) 6.3909s (±2.8%) 5.5233s (±3.2%)
Semantic (cleanup) 0.0006s (±4.2%) 0.0006s (±2.4%) 0.0006s (±2.7%)
Semantic (recursive struct check) 0.0012s (±3.6%) 0.0012s (±2.8%) 0.0012s (±8.6%)
Codegen (crystal) 2.6454s (±9.7%) 2.7394s (±3.5%) 2.8363s (±3.8%)
Codegen (bc+obj) 5.9099s (±2.8%) 6.0044s (±2.3%) 5.1995s (±0.8%)
Codegen (linking) 0.7582s (±1.5%) 0.7576s (±1.4%) 0.3392s (±19.1%)
dsymutil 0.3473s (±2.0%) 0.3486s (±1.6%) 0.3940s (±2.9%)
Macro runs 4.6345s (±1.4%) 4.6609s (±1.9%) 3.0254s (±3.3%)

Plus 1 run in release mode (only the stages beyond Crystal's control are shown because the other times are unaffected):

LLVM 14.0.1 (c6e3116) LLVM 14.0.1 (cfd9d60) LLVM 15.0.7 (cfd9d60)
Codegen (bc+obj) 247.8567s 251.4313s 184.3743
Codegen (linking) 0.4536s 0.4714s 0.3295s
dsymutil 0.6281s 0.6342s 0.5236s

* Support typed LLVM `call` and `invoke` instructions

* fixup
* allow using llvm 15

* use opaque pointers on llvm 15+

* opaque pointer names in llvm intrinsics

* uwtable -> uwtable(async)

* use unnamed llvm structs for lib fun bindings of llvm intrinsics

* ci support

* fix uwtable value

* `uwtable(async)` outside aarch64

* don't use string interpolation
…ystal-lang#13171)

* `bit_cast`, obvious cases

* `__crystal_once`

* `__crystal_get_exception`

* `__crystal_raise`

* use `cast_to_void_pointer` in more places

* `cast_to` and `cast_to_pointer`

* `pointer_cast` is always a macro
* Deprecate LLVM typed pointers

* don't remove the funs yet

* fixup
@beta-ziliani
Copy link
Member

Besides the formatting of codegen that is failing, the rest is 💚
Thanks Quinton for the awesome work 🙇 !

@beta-ziliani beta-ziliani added this to the 1.8.0 milestone Mar 10, 2023
@straight-shoota straight-shoota merged commit 01be77a into crystal-lang:master Mar 11, 2023
@HertzDevil HertzDevil deleted the feature/llvm-15-final branch March 11, 2023 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support LLVM 15 LLVM will switch to opaque pointers soon
3 participants