Skip to content

Commit

Permalink
Update melior
Browse files Browse the repository at this point in the history
  • Loading branch information
edg-l committed Jan 20, 2025
1 parent 965e3f9 commit ff4ddbc
Show file tree
Hide file tree
Showing 50 changed files with 114 additions and 212 deletions.
215 changes: 53 additions & 162 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ itertools = "0.13.0"
lazy_static = "1.5"
libc = "0.2"
llvm-sys = "191.0.0"
melior = { version = "0.20.2", features = ["ods-dialects", "helpers"] }
melior = { version = "0.21.0", features = ["ods-dialects", "helpers"] }
mlir-sys = { version = "0.4.1" }
num-bigint = "0.4.6"
num-traits = "0.2"
Expand Down
4 changes: 2 additions & 2 deletions src/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ use melior::{
},
operation::OperationBuilder,
r#type::{FunctionType, IntegerType, MemRefType},
Attribute, AttributeLike, Block, BlockRef, Identifier, Location, Module, Region, Type,
Value,
Attribute, AttributeLike, Block, BlockLike, BlockRef, Identifier, Location, Module, Region,
Type, Value,
},
Context,
};
Expand Down
2 changes: 1 addition & 1 deletion src/libfuncs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use cairo_lang_sierra::{
};
use melior::{
dialect::{arith, cf},
ir::{Block, BlockRef, Location, Module, Operation, Region, Value},
ir::{Block, BlockLike, BlockRef, Location, Module, Operation, Region, Value},
Context,
};
use num_bigint::BigInt;
Expand Down
3 changes: 2 additions & 1 deletion src/libfuncs/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ use melior::{
cf, llvm, ods, scf,
},
ir::{
attribute::IntegerAttribute, r#type::IntegerType, Block, Location, Region, Value, ValueLike,
attribute::IntegerAttribute, r#type::IntegerType, Block, BlockLike, Location, Region,
Value, ValueLike,
},
Context,
};
Expand Down
2 changes: 1 addition & 1 deletion src/libfuncs/bool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use cairo_lang_sierra::{
};
use melior::{
dialect::{arith, llvm},
ir::{r#type::IntegerType, Block, Location},
ir::{r#type::IntegerType, Block, BlockLike, Location},
Context,
};

Expand Down
2 changes: 1 addition & 1 deletion src/libfuncs/bounded_int.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use melior::{
arith::{self, CmpiPredicate},
cf,
},
ir::{r#type::IntegerType, Block, Location, Value, ValueLike},
ir::{r#type::IntegerType, Block, BlockLike, Location, Value, ValueLike},
Context,
};
use num_bigint::{BigInt, Sign};
Expand Down
2 changes: 1 addition & 1 deletion src/libfuncs/box.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use melior::{
llvm::{self, r#type::pointer, LoadStoreOptions},
ods,
},
ir::{attribute::IntegerAttribute, r#type::IntegerType, Block, Location},
ir::{attribute::IntegerAttribute, r#type::IntegerType, Block, BlockLike, Location},
Context,
};

Expand Down
2 changes: 1 addition & 1 deletion src/libfuncs/bytes31.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use melior::{
arith::{self, CmpiPredicate},
cf,
},
ir::{Attribute, Block, Location, Value},
ir::{Attribute, Block, BlockLike, Location, Value},
Context,
};
use num_bigint::BigUint;
Expand Down
2 changes: 1 addition & 1 deletion src/libfuncs/cast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use cairo_lang_sierra::{
};
use melior::{
dialect::arith::{self, CmpiPredicate},
ir::{r#type::IntegerType, Block, Location, Value, ValueLike},
ir::{r#type::IntegerType, Block, BlockLike, Location, Value, ValueLike},
Context,
};
use num_bigint::{BigInt, Sign};
Expand Down
3 changes: 2 additions & 1 deletion src/libfuncs/circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ use melior::{
cf, llvm,
},
ir::{
attribute::DenseI32ArrayAttribute, r#type::IntegerType, Block, Location, Value, ValueLike,
attribute::DenseI32ArrayAttribute, r#type::IntegerType, Block, BlockLike, Location, Value,
ValueLike,
},
Context,
};
Expand Down
2 changes: 1 addition & 1 deletion src/libfuncs/const.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use cairo_lang_sierra::{
};
use melior::{
dialect::llvm::{self, r#type::pointer},
ir::{Block, Location, Value},
ir::{Block, BlockLike, Location, Value},
Context,
};
use num_bigint::Sign;
Expand Down
2 changes: 1 addition & 1 deletion src/libfuncs/coupon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use cairo_lang_sierra::{
};
use melior::{
dialect::llvm,
ir::{Block, Location},
ir::{Block, BlockLike, Location},
Context,
};

Expand Down
2 changes: 1 addition & 1 deletion src/libfuncs/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use cairo_lang_sierra::{
};
use melior::{
dialect::{arith, cf, llvm},
ir::{r#type::IntegerType, Block, Location},
ir::{r#type::IntegerType, Block, BlockLike, Location},
Context,
};

Expand Down
2 changes: 1 addition & 1 deletion src/libfuncs/drop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use cairo_lang_sierra::{
program_registry::ProgramRegistry,
};
use melior::{
ir::{Block, Location},
ir::{Block, BlockLike, Location},
Context,
};

Expand Down
2 changes: 1 addition & 1 deletion src/libfuncs/dup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use cairo_lang_sierra::{
program_registry::ProgramRegistry,
};
use melior::{
ir::{Block, Location},
ir::{Block, BlockLike, Location},
Context,
};

Expand Down
2 changes: 1 addition & 1 deletion src/libfuncs/ec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use melior::{
arith::{self, CmpiPredicate},
llvm,
},
ir::{operation::OperationBuilder, r#type::IntegerType, Block, Location},
ir::{operation::OperationBuilder, r#type::IntegerType, Block, BlockLike, Location},
Context,
};

Expand Down
2 changes: 1 addition & 1 deletion src/libfuncs/enum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use melior::{
ir::{
attribute::{DenseI64ArrayAttribute, IntegerAttribute},
r#type::IntegerType,
Block, Location, Value,
Block, BlockLike, Location, Value,
},
Context,
};
Expand Down
2 changes: 1 addition & 1 deletion src/libfuncs/felt252.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use melior::{
arith::{self, CmpiPredicate},
cf,
},
ir::{r#type::IntegerType, Block, Location, Value, ValueLike},
ir::{r#type::IntegerType, Block, BlockLike, Location, Value, ValueLike},
Context,
};
use num_bigint::{BigInt, Sign};
Expand Down
2 changes: 1 addition & 1 deletion src/libfuncs/felt252_dict.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use cairo_lang_sierra::{
};
use melior::{
dialect::{llvm, ods},
ir::{Block, Location},
ir::{Block, BlockLike, Location},
Context,
};

Expand Down
2 changes: 1 addition & 1 deletion src/libfuncs/felt252_dict_entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use cairo_lang_sierra::{
};
use melior::{
dialect::{llvm, scf},
ir::{r#type::IntegerType, Block, Location, Region},
ir::{r#type::IntegerType, Block, BlockLike, Location, Region},
Context,
};
use std::cell::Cell;
Expand Down
2 changes: 1 addition & 1 deletion src/libfuncs/function_call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use melior::{
attribute::{DenseI32ArrayAttribute, FlatSymbolRefAttribute},
operation::OperationBuilder,
r#type::IntegerType,
Attribute, Block, Identifier, Location, Type, Value,
Attribute, Block, BlockLike, Identifier, Location, Type, Value,
},
Context,
};
Expand Down
2 changes: 1 addition & 1 deletion src/libfuncs/gas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use cairo_lang_sierra::{
};
use melior::{
dialect::{arith::CmpiPredicate, ods},
ir::{r#type::IntegerType, Block, Location},
ir::{r#type::IntegerType, Block, BlockLike, Location},
Context,
};

Expand Down
2 changes: 1 addition & 1 deletion src/libfuncs/int.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use melior::{
},
ir::{
attribute::IntegerAttribute, operation::OperationBuilder, r#type::IntegerType, Block,
Location, Region, ValueLike,
BlockLike, Location, Region, ValueLike,
},
Context,
};
Expand Down
2 changes: 1 addition & 1 deletion src/libfuncs/int_range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use melior::{
arith::{self, CmpiPredicate},
ods,
},
ir::{Block, Location},
ir::{Block, BlockLike, Location},
Context,
};
use num_bigint::BigInt;
Expand Down
2 changes: 1 addition & 1 deletion src/libfuncs/mem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use cairo_lang_sierra::{
};
use melior::{
dialect::llvm,
ir::{Block, Location},
ir::{Block, BlockLike, Location},
Context,
};

Expand Down
2 changes: 1 addition & 1 deletion src/libfuncs/nullable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use melior::{
dialect::{cf, llvm::r#type::pointer, ods},
ir::{
attribute::IntegerAttribute, operation::OperationBuilder, r#type::IntegerType, Block,
Identifier, Location,
BlockLike, Identifier, Location,
},
Context,
};
Expand Down
2 changes: 1 addition & 1 deletion src/libfuncs/pedersen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use cairo_lang_sierra::{
program_registry::ProgramRegistry,
};
use melior::{
ir::{r#type::IntegerType, Block, Location},
ir::{r#type::IntegerType, Block, BlockLike, Location},
Context,
};

Expand Down
2 changes: 1 addition & 1 deletion src/libfuncs/poseidon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use cairo_lang_sierra::{
};
use melior::{
dialect::ods,
ir::{r#type::IntegerType, Block, Location},
ir::{r#type::IntegerType, Block, BlockLike, Location},
Context,
};

Expand Down
2 changes: 1 addition & 1 deletion src/libfuncs/starknet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use melior::{
},
ir::{
attribute::DenseI64ArrayAttribute, operation::OperationBuilder, r#type::IntegerType,
Attribute, Block, Location, Type, ValueLike,
Attribute, Block, BlockLike, Location, Type, ValueLike,
},
Context,
};
Expand Down
2 changes: 1 addition & 1 deletion src/libfuncs/starknet/secp256.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use melior::{
dialect::llvm::{self, LoadStoreOptions},
ir::{
attribute::DenseI32ArrayAttribute, operation::OperationBuilder, r#type::IntegerType, Block,
Location,
BlockLike, Location,
},
Context,
};
Expand Down
2 changes: 1 addition & 1 deletion src/libfuncs/starknet/testing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use melior::{
ir::{
attribute::{IntegerAttribute, TypeAttribute},
r#type::IntegerType,
Block, Location,
Block, BlockLike, Location,
},
Context,
};
Expand Down
2 changes: 1 addition & 1 deletion src/libfuncs/struct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use cairo_lang_sierra::{
};
use melior::{
dialect::llvm,
ir::{Block, Location, Value},
ir::{Block, BlockLike, Location, Value},
Context,
};

Expand Down
2 changes: 1 addition & 1 deletion src/libfuncs/uint256.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use melior::{
attribute::{DenseI64ArrayAttribute, IntegerAttribute},
operation::OperationBuilder,
r#type::IntegerType,
Block, Location, Region, Value,
Block, BlockLike, Location, Region, Value,
},
Context,
};
Expand Down
2 changes: 1 addition & 1 deletion src/libfuncs/uint512.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use cairo_lang_sierra::{
};
use melior::{
dialect::{arith, llvm},
ir::{r#type::IntegerType, Block, Location, Value},
ir::{r#type::IntegerType, Block, BlockLike, Location, Value},
Context,
};

Expand Down
2 changes: 1 addition & 1 deletion src/metadata/debug_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ use melior::{
attribute::{FlatSymbolRefAttribute, IntegerAttribute, StringAttribute, TypeAttribute},
operation::OperationBuilder,
r#type::{FunctionType, IntegerType},
Block, Identifier, Location, Module, Region, Value,
Block, BlockLike, Identifier, Location, Module, Region, Value,
},
Context, ExecutionEngine,
};
Expand Down
2 changes: 1 addition & 1 deletion src/metadata/drop_overrides.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ use melior::{
ir::{
attribute::{FlatSymbolRefAttribute, StringAttribute, TypeAttribute},
r#type::FunctionType,
Attribute, Block, Identifier, Location, Module, Region, Value,
Attribute, Block, BlockLike, Identifier, Location, Module, Region, Value,
},
Context,
};
Expand Down
2 changes: 1 addition & 1 deletion src/metadata/dup_overrides.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ use melior::{
ir::{
attribute::{FlatSymbolRefAttribute, StringAttribute, TypeAttribute},
r#type::FunctionType,
Attribute, Block, Identifier, Location, Module, Region, Value, ValueLike,
Attribute, Block, BlockLike, Identifier, Location, Module, Region, Value, ValueLike,
},
Context,
};
Expand Down
2 changes: 1 addition & 1 deletion src/metadata/felt252_dict.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use melior::{
dialect::llvm,
ir::{
attribute::{FlatSymbolRefAttribute, StringAttribute, TypeAttribute},
Attribute, Block, Identifier, Location, Module, Region,
Attribute, Block, BlockLike, Identifier, Location, Module, Region,
},
Context,
};
Expand Down
2 changes: 1 addition & 1 deletion src/metadata/realloc_bindings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use melior::{
attribute::{FlatSymbolRefAttribute, StringAttribute, TypeAttribute},
operation::OperationBuilder,
r#type::IntegerType,
Identifier, Location, Module, Operation, Region, Value,
BlockLike, Identifier, Location, Module, Operation, Region, Value,
},
Context, Error,
};
Expand Down
2 changes: 1 addition & 1 deletion src/metadata/runtime_bindings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use melior::{
ir::{
attribute::{FlatSymbolRefAttribute, StringAttribute, TypeAttribute},
r#type::{FunctionType, IntegerType},
Attribute, Block, Identifier, Location, Module, OperationRef, Region, Value,
Attribute, Block, BlockLike, Identifier, Location, Module, OperationRef, Region, Value,
},
Context,
};
Expand Down
5 changes: 4 additions & 1 deletion src/types/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,16 @@ use cairo_lang_sierra::{
},
program_registry::ProgramRegistry,
};
use melior::dialect::{arith::CmpiPredicate, func, scf};
use melior::ir::Region;
use melior::{
dialect::{arith, llvm},
ir::{r#type::IntegerType, Block, Location, Module, Type},
Context,
};
use melior::{
dialect::{arith::CmpiPredicate, func, scf},
ir::BlockLike,
};

/// Build the MLIR type.
///
Expand Down
5 changes: 4 additions & 1 deletion src/types/box.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ use cairo_lang_sierra::{
};
use melior::{
dialect::{func, llvm, ods},
ir::{attribute::IntegerAttribute, r#type::IntegerType, Block, Location, Module, Region, Type},
ir::{
attribute::IntegerAttribute, r#type::IntegerType, Block, BlockLike, Location, Module,
Region, Type,
},
Context,
};

Expand Down
Loading

0 comments on commit ff4ddbc

Please sign in to comment.