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

Update to LLVM 18 (and Rust 1.78) #566

Merged
merged 49 commits into from
May 22, 2024
Merged

Update to LLVM 18 (and Rust 1.78) #566

merged 49 commits into from
May 22, 2024

Conversation

edg-l
Copy link
Collaborator

@edg-l edg-l commented May 3, 2024

Fixes #290

@edg-l edg-l force-pushed the update_to_llvm18 branch 2 times, most recently from 7dbc45e to 826c0e7 Compare May 6, 2024 09:51
@edg-l edg-l mentioned this pull request May 6, 2024
5 tasks
@edg-l edg-l force-pushed the update_to_llvm18 branch 2 times, most recently from 9cbf1c1 to 4bb6ca5 Compare May 7, 2024 12:10
@edg-l edg-l marked this pull request as ready for review May 22, 2024 14:13
@edg-l
Copy link
Collaborator Author

edg-l commented May 22, 2024

Should be ready

igaray
igaray previously approved these changes May 22, 2024
@edg-l edg-l added the review-ready A PR that is ready for review label May 22, 2024
#[test]
fn felt252_add() {
// run_program_assert_output(
Copy link
Collaborator

Choose a reason for hiding this comment

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

why this is commented?

@edg-l edg-l enabled auto-merge May 22, 2024 16:04
@edg-l edg-l added this pull request to the merge queue May 22, 2024
Merged via the queue into main with commit 0b3fe0a May 22, 2024
9 checks passed
@edg-l edg-l deleted the update_to_llvm18 branch May 22, 2024 17:04
Comment on lines +366 to +367
#[cfg(not(target_arch = "x86_64"))]
const NUM_REGISTER_ARGS: usize = 8;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since we don't know about other architectures I'd leave it as #[cfg(target_arch = "aarch64")] instead.

On architectures that are neither x86_64 nor aarch64 it'll fail with a compilation error. When that happens we can look into them.

if self.invoke_data.len() & 1 != 0 {
self.invoke_data.push(0);
}
} else if self.invoke_data.len() + 1 >= 8 {
} else if self.invoke_data.len() + 1 >= NUM_REGISTER_ARGS {
Copy link
Collaborator

Choose a reason for hiding this comment

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

You missed one 8 value 4 lines below this one in new_len >= 8.

@@ -247,7 +247,7 @@ mod tests {
tag: 0,
value: JitValue::Struct {
fields: vec![JitValue::Felt252(
syscall_handler.get_block_hash(0, &mut 0).unwrap(),
syscall_handler.get_block_hash(1, &mut 0).unwrap(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is this different?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

i changed the testsyscall handler to return its input, so we can test with more values

@@ -23,7 +23,7 @@ use cairo_lang_sierra::{
use melior::{
dialect::{
cf,
llvm::{self, r#type::opaque_pointer},
llvm::{self},
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
llvm::{self},
llvm,

Comment on lines +18 to 19
#[cfg_attr(target_arch = "x86_64", repr(C, align(16)))]
#[cfg_attr(not(target_arch = "x86_64"), repr(C, align(16)))]
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is no longer necessary (the cfg_attr).

Comment on lines +25 to 26
#[cfg_attr(target_arch = "x86_64", repr(C, align(16)))]
#[cfg_attr(not(target_arch = "x86_64"), repr(C, align(16)))]
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is no longer necessary (the cfg_attr).

@edg-l edg-l mentioned this pull request May 23, 2024
5 tasks
@tcoratger tcoratger mentioned this pull request May 24, 2024
5 tasks
Gerson2102 pushed a commit to Gerson2102/cairo_native that referenced this pull request May 26, 2024
* update to llvm 18

* fix clippy

* fix

* fix clippy

* unignore felt to bool bug

* unignore tests

* unignore test storage_base_address_from_felt252

* fix bench script

* comment sec r1 new test

* fix ci

* upd lockfile

* update dockerfile

* fix

* ignore test

* align to 16 on x86

* try

* unwrap

* fix assert

* x

* fix

* fix get_integer_layout2

* rust 1.78 and fix array from jit

* bug

* Fix slice from null pointer bug.

* clippy

* try fix push aligned

* update felt abi align

* unignore test to not miss it

* update runtime to use proper felt abi

* evert "update runtime to use proper felt abi"

This reverts commit a02993e.

* fix push_aligned on x86 with 16 align

* format2

* unignore self referencing test

* fix get_execution_info_v2

* unignore more tests

* remove old todo

* uncomment code

---------

Co-authored-by: Esteve Soler Arderiu <soler.arderiu@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority review-ready A PR that is ready for review
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Failing test: felt252_to_bool_bug
4 participants