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 15 preparations #5614

Merged
merged 4 commits into from
Jun 27, 2023
Merged

Llvm 15 preparations #5614

merged 4 commits into from
Jun 27, 2023

Conversation

folkertdev
Copy link
Contributor

some changes to make the llvm 15 upgrade easier

  • in the next release, more llvm operations need a type argument
  • enum values that are not 0 cause issues
  • we should generally prefer 32-bit indices for GEP

@@ -166,7 +166,7 @@ fn gen_from_mono_module_llvm<'a>(

let kind_id = Attribute::get_named_enum_kind_id("alwaysinline");
debug_assert!(kind_id > 0);
let enum_attr = context.create_enum_attribute(kind_id, 1);
let enum_attr = context.create_enum_attribute(kind_id, 0);
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

Why does this need to change? Can we please lift the 0 to a constant? Here and below.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

well it needs to change because in llvm a value of 1 just does not work, and causes weird LLVM issues (the attribute is just invalid and llvm verification fails).

so, this is not a constant, the value has no meaning, and 0 just turns out to be ignored by llvm 15 (and 16). So I don't know what a constant would add here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

also, this broke because it was never tested. I've opened a PR on inkwell to test these function attributes

@folkertdev folkertdev merged commit 7b19a15 into main Jun 27, 2023
10 checks passed
@folkertdev folkertdev deleted the llvm-15-preparations branch June 27, 2023 17:30
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.

2 participants