From c283a95ebd4ed76f3bb26b7e160faa1674e565fb Mon Sep 17 00:00:00 2001 From: "github-merge-queue[bot]" Date: Thu, 21 Nov 2024 14:34:12 +0000 Subject: [PATCH] deploy: 107ff62555b9c65acb4897ed7041ba4e17d85689 --- help.html | 2 +- settings.html | 2 +- src-files.js | 4 +- src/cairo_native/compiler.rs.html | 12 +- src/cairo_native/libfuncs.rs.html | 192 +++++++++++---- src/cairo_native/libfuncs/ap_tracking.rs.html | 175 ------------- src/cairo_native/libfuncs/bounded_int.rs.html | 22 +- src/cairo_native/libfuncs/box.rs.html | 32 +-- .../libfuncs/branch_align.rs.html | 67 ----- src/cairo_native/libfuncs/circuit.rs.html | 110 ++------- src/cairo_native/libfuncs/mem.rs.html | 118 +++------ src/cairo_native/libfuncs/nullable.rs.html | 82 ++----- .../libfuncs/snapshot_take.rs.html | 59 ----- src/cairo_native/libfuncs/starknet.rs.html | 230 ++---------------- .../libfuncs/unconditional_jump.rs.html | 61 ----- .../libfuncs/unwrap_non_zero.rs.html | 61 ----- 16 files changed, 248 insertions(+), 981 deletions(-) delete mode 100644 src/cairo_native/libfuncs/ap_tracking.rs.html delete mode 100644 src/cairo_native/libfuncs/branch_align.rs.html delete mode 100644 src/cairo_native/libfuncs/snapshot_take.rs.html delete mode 100644 src/cairo_native/libfuncs/unconditional_jump.rs.html delete mode 100644 src/cairo_native/libfuncs/unwrap_non_zero.rs.html diff --git a/help.html b/help.html index d6fdaa571..ca7a56a51 100644 --- a/help.html +++ b/help.html @@ -1 +1 @@ -Help

Rustdoc help

Back
\ No newline at end of file +Help

Rustdoc help

Back
\ No newline at end of file diff --git a/settings.html b/settings.html index 267049dc2..c834a1cde 100644 --- a/settings.html +++ b/settings.html @@ -1 +1 @@ -Settings

Rustdoc settings

Back
\ No newline at end of file +Settings

Rustdoc settings

Back
\ No newline at end of file diff --git a/src-files.js b/src-files.js index 123e306a8..30319e8f1 100644 --- a/src-files.js +++ b/src-files.js @@ -1,3 +1,3 @@ -var srcIndex = new Map(JSON.parse('[["cairo_native",["",[["arch",[],["x86_64.rs"]],["cache",[],["aot.rs","jit.rs"]],["executor",[],["aot.rs","contract.rs","jit.rs"]],["libfuncs",[["starknet",[],["secp256.rs","testing.rs"]]],["ap_tracking.rs","array.rs","bitwise.rs","bool.rs","bounded_int.rs","box.rs","branch_align.rs","bytes31.rs","cast.rs","circuit.rs","const.rs","coupon.rs","debug.rs","drop.rs","dup.rs","ec.rs","enum.rs","felt252.rs","felt252_dict.rs","felt252_dict_entry.rs","function_call.rs","gas.rs","int_range.rs","mem.rs","nullable.rs","pedersen.rs","poseidon.rs","sint128.rs","sint16.rs","sint32.rs","sint64.rs","sint8.rs","snapshot_take.rs","starknet.rs","struct.rs","uint128.rs","uint16.rs","uint256.rs","uint32.rs","uint512.rs","uint64.rs","uint8.rs","unconditional_jump.rs","unwrap_non_zero.rs"]],["metadata",[],["auto_breakpoint.rs","debug_utils.rs","drop_overrides.rs","dup_overrides.rs","enum_snapshot_variants.rs","gas.rs","realloc_bindings.rs","runtime_bindings.rs","tail_recursion.rs"]],["types",[],["array.rs","bitwise.rs","bounded_int.rs","box.rs","builtin_costs.rs","bytes31.rs","circuit.rs","coupon.rs","ec_op.rs","ec_point.rs","ec_state.rs","enum.rs","felt252.rs","felt252_dict.rs","felt252_dict_entry.rs","gas_builtin.rs","int_range.rs","non_zero.rs","nullable.rs","pedersen.rs","poseidon.rs","range_check.rs","segment_arena.rs","snapshot.rs","squashed_felt252_dict.rs","starknet.rs","struct.rs","uint128.rs","uint128_mul_guarantee.rs","uint16.rs","uint32.rs","uint64.rs","uint8.rs","uninitialized.rs"]],["utils",[],["block_ext.rs","mem_tracing.rs","program_registry_ext.rs","range_ext.rs"]]],["arch.rs","cache.rs","compiler.rs","context.rs","debug.rs","docs.rs","error.rs","execution_result.rs","executor.rs","ffi.rs","lib.rs","libfuncs.rs","metadata.rs","module.rs","starknet.rs","starknet_stub.rs","types.rs","utils.rs","values.rs"]]],["cairo_native_compile",["",[],["cairo-native-compile.rs"]]],["cairo_native_dump",["",[],["cairo-native-dump.rs"]]],["cairo_native_run",["",[["utils",[],["mod.rs","test.rs"]]],["cairo-native-run.rs"]]],["cairo_native_runtime",["",[],["lib.rs"]]],["cairo_native_stress",["",[],["main.rs"]]],["cairo_native_test",["",[["utils",[],["mod.rs","test.rs"]]],["cairo-native-test.rs"]]],["scarb_native_dump",["",[["utils",[],["mod.rs","test.rs"]]],["scarb-native-dump.rs"]]],["scarb_native_test",["",[["utils",[],["mod.rs","test.rs"]]],["scarb-native-test.rs"]]]]')); +var srcIndex = new Map(JSON.parse('[["cairo_native",["",[["arch",[],["x86_64.rs"]],["cache",[],["aot.rs","jit.rs"]],["executor",[],["aot.rs","contract.rs","jit.rs"]],["libfuncs",[["starknet",[],["secp256.rs","testing.rs"]]],["array.rs","bitwise.rs","bool.rs","bounded_int.rs","box.rs","bytes31.rs","cast.rs","circuit.rs","const.rs","coupon.rs","debug.rs","drop.rs","dup.rs","ec.rs","enum.rs","felt252.rs","felt252_dict.rs","felt252_dict_entry.rs","function_call.rs","gas.rs","int_range.rs","mem.rs","nullable.rs","pedersen.rs","poseidon.rs","sint128.rs","sint16.rs","sint32.rs","sint64.rs","sint8.rs","starknet.rs","struct.rs","uint128.rs","uint16.rs","uint256.rs","uint32.rs","uint512.rs","uint64.rs","uint8.rs"]],["metadata",[],["auto_breakpoint.rs","debug_utils.rs","drop_overrides.rs","dup_overrides.rs","enum_snapshot_variants.rs","gas.rs","realloc_bindings.rs","runtime_bindings.rs","tail_recursion.rs"]],["types",[],["array.rs","bitwise.rs","bounded_int.rs","box.rs","builtin_costs.rs","bytes31.rs","circuit.rs","coupon.rs","ec_op.rs","ec_point.rs","ec_state.rs","enum.rs","felt252.rs","felt252_dict.rs","felt252_dict_entry.rs","gas_builtin.rs","int_range.rs","non_zero.rs","nullable.rs","pedersen.rs","poseidon.rs","range_check.rs","segment_arena.rs","snapshot.rs","squashed_felt252_dict.rs","starknet.rs","struct.rs","uint128.rs","uint128_mul_guarantee.rs","uint16.rs","uint32.rs","uint64.rs","uint8.rs","uninitialized.rs"]],["utils",[],["block_ext.rs","mem_tracing.rs","program_registry_ext.rs","range_ext.rs"]]],["arch.rs","cache.rs","compiler.rs","context.rs","debug.rs","docs.rs","error.rs","execution_result.rs","executor.rs","ffi.rs","lib.rs","libfuncs.rs","metadata.rs","module.rs","starknet.rs","starknet_stub.rs","types.rs","utils.rs","values.rs"]]],["cairo_native_compile",["",[],["cairo-native-compile.rs"]]],["cairo_native_dump",["",[],["cairo-native-dump.rs"]]],["cairo_native_run",["",[["utils",[],["mod.rs","test.rs"]]],["cairo-native-run.rs"]]],["cairo_native_runtime",["",[],["lib.rs"]]],["cairo_native_stress",["",[],["main.rs"]]],["cairo_native_test",["",[["utils",[],["mod.rs","test.rs"]]],["cairo-native-test.rs"]]],["scarb_native_dump",["",[["utils",[],["mod.rs","test.rs"]]],["scarb-native-dump.rs"]]],["scarb_native_test",["",[["utils",[],["mod.rs","test.rs"]]],["scarb-native-test.rs"]]]]')); createSrcSidebar(); -//{"start":36,"fragment_lengths":[1830,61,55,86,44,44,88,88,88]} \ No newline at end of file +//{"start":36,"fragment_lengths":[1731,61,55,86,44,44,88,88,88]} \ No newline at end of file diff --git a/src/cairo_native/compiler.rs.html b/src/cairo_native/compiler.rs.html index 0be8c1287..c81305d0a 100644 --- a/src/cairo_native/compiler.rs.html +++ b/src/cairo_native/compiler.rs.html @@ -1397,10 +1397,6 @@ 1397 1398 1399 -1400 -1401 -1402 -1403
//! # Compilation process
 //!
 //! A Sierra program is compiled one function at a time. Each function has a pre-entry block that
@@ -2017,9 +2013,8 @@
                         invocation
                             .branches
                             .iter()
-                            .zip(helper.results())
+                            .zip(helper.results()?)
                             .map(|(branch_info, result_values)| {
-                                let result_values = result_values?;
                                 assert_eq!(
                                     branch_info.results.len(),
                                     result_values.len(),
@@ -2028,10 +2023,7 @@
 
                                 Ok(edit_state::put_results(
                                     state.clone(),
-                                    branch_info
-                                        .results
-                                        .iter()
-                                        .zip(result_values.iter().copied()),
+                                    branch_info.results.iter().zip(result_values.into_iter()),
                                 )?)
                             })
                             .collect::<Result<_, Error>>()?,
diff --git a/src/cairo_native/libfuncs.rs.html b/src/cairo_native/libfuncs.rs.html
index 5123251f4..5a818d131 100644
--- a/src/cairo_native/libfuncs.rs.html
+++ b/src/cairo_native/libfuncs.rs.html
@@ -443,18 +443,70 @@
 443
 444
 445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
 
//! # Compiler libfunc infrastructure
 //!
 //! Contains libfunc generation stuff (aka. the actual instructions).
 
 use crate::{
-    error::{panic::ToNativeAssertError, Error as CoreLibfuncBuilderError, Result as NativeResult},
+    error::{panic::ToNativeAssertError, Error as CoreLibfuncBuilderError, Result},
     metadata::MetadataStorage,
+    types::TypeBuilder,
     utils::BlockExt,
 };
 use bumpalo::Bump;
 use cairo_lang_sierra::{
-    extensions::core::{CoreConcreteLibfunc, CoreLibfunc, CoreType},
+    extensions::{
+        core::{CoreConcreteLibfunc, CoreLibfunc, CoreType, CoreTypeConcrete},
+        lib_func::ParamSignature,
+        starknet::StarkNetTypeConcrete,
+        ConcreteLibfunc,
+    },
     ids::FunctionId,
     program_registry::ProgramRegistry,
 };
@@ -466,13 +518,11 @@
 use num_bigint::BigInt;
 use std::{cell::Cell, error::Error, ops::Deref};
 
-mod ap_tracking;
 mod array;
 mod bitwise;
 mod r#bool;
 mod bounded_int;
 mod r#box;
-mod branch_align;
 mod bytes31;
 mod cast;
 mod circuit;
@@ -498,7 +548,6 @@
 mod sint32;
 mod sint64;
 mod sint8;
-mod snapshot_take;
 mod starknet;
 mod r#struct;
 mod uint128;
@@ -508,8 +557,6 @@
 mod uint512;
 mod uint64;
 mod uint8;
-mod unconditional_jump;
-mod unwrap_non_zero;
 
 /// Generation of MLIR operations from their Sierra counterparts.
 ///
@@ -528,7 +575,7 @@
         location: Location<'ctx>,
         helper: &LibfuncHelper<'ctx, 'this>,
         metadata: &mut MetadataStorage,
-    ) -> Result<(), Self::Error>;
+    ) -> Result<()>;
 
     /// Return the target function if the statement is a function call.
     ///
@@ -548,20 +595,28 @@
         location: Location<'ctx>,
         helper: &LibfuncHelper<'ctx, 'this>,
         metadata: &mut MetadataStorage,
-    ) -> Result<(), Self::Error> {
+    ) -> Result<()> {
         match self {
-            Self::ApTracking(selector) => self::ap_tracking::build(
-                context, registry, entry, location, helper, metadata, selector,
-            ),
+            Self::ApTracking(_) | Self::BranchAlign(_) | Self::UnconditionalJump(_) => {
+                build_noop::<0, true>(
+                    context,
+                    registry,
+                    entry,
+                    location,
+                    helper,
+                    metadata,
+                    self.param_signatures(),
+                )
+            }
             Self::Array(selector) => self::array::build(
                 context, registry, entry, location, helper, metadata, selector,
             ),
-            Self::BranchAlign(info) => self::branch_align::build(
-                context, registry, entry, location, helper, metadata, info,
-            ),
             Self::Bool(selector) => self::r#bool::build(
                 context, registry, entry, location, helper, metadata, selector,
             ),
+            Self::BoundedInt(info) => {
+                self::bounded_int::build(context, registry, entry, location, helper, metadata, info)
+            }
             Self::Box(selector) => self::r#box::build(
                 context, registry, entry, location, helper, metadata, selector,
             ),
@@ -571,16 +626,25 @@
             Self::Cast(selector) => self::cast::build(
                 context, registry, entry, location, helper, metadata, selector,
             ),
+            Self::Circuit(info) => {
+                self::circuit::build(context, registry, entry, location, helper, metadata, info)
+            }
             Self::Const(selector) => self::r#const::build(
                 context, registry, entry, location, helper, metadata, selector,
             ),
+            Self::Coupon(info) => {
+                self::coupon::build(context, registry, entry, location, helper, metadata, info)
+            }
+            Self::CouponCall(info) => self::function_call::build(
+                context, registry, entry, location, helper, metadata, info,
+            ),
             Self::Debug(selector) => self::debug::build(
                 context, registry, entry, location, helper, metadata, selector,
             ),
             Self::Drop(info) => {
                 self::drop::build(context, registry, entry, location, helper, metadata, info)
             }
-            Self::Dup(info) => {
+            Self::Dup(info) | Self::SnapshotTake(info) => {
                 self::dup::build(context, registry, entry, location, helper, metadata, info)
             }
             Self::Ec(selector) => self::ec::build(
@@ -604,6 +668,9 @@
             Self::Gas(selector) => self::gas::build(
                 context, registry, entry, location, helper, metadata, selector,
             ),
+            Self::IntRange(selector) => self::int_range::build(
+                context, registry, entry, location, helper, metadata, selector,
+            ),
             Self::Mem(selector) => self::mem::build(
                 context, registry, entry, location, helper, metadata, selector,
             ),
@@ -631,9 +698,6 @@
             Self::Sint128(info) => {
                 self::sint128::build(context, registry, entry, location, helper, metadata, info)
             }
-            Self::SnapshotTake(info) => self::snapshot_take::build(
-                context, registry, entry, location, helper, metadata, info,
-            ),
             Self::StarkNet(selector) => self::starknet::build(
                 context, registry, entry, location, helper, metadata, selector,
             ),
@@ -661,26 +725,14 @@
             Self::Uint512(selector) => self::uint512::build(
                 context, registry, entry, location, helper, metadata, selector,
             ),
-            Self::UnconditionalJump(info) => self::unconditional_jump::build(
-                context, registry, entry, location, helper, metadata, info,
-            ),
-            Self::UnwrapNonZero(info) => self::unwrap_non_zero::build(
-                context, registry, entry, location, helper, metadata, info,
-            ),
-            Self::Coupon(info) => {
-                self::coupon::build(context, registry, entry, location, helper, metadata, info)
-            }
-            Self::CouponCall(info) => self::function_call::build(
-                context, registry, entry, location, helper, metadata, info,
-            ),
-            Self::Circuit(info) => {
-                self::circuit::build(context, registry, entry, location, helper, metadata, info)
-            }
-            Self::BoundedInt(info) => {
-                self::bounded_int::build(context, registry, entry, location, helper, metadata, info)
-            }
-            Self::IntRange(selector) => self::int_range::build(
-                context, registry, entry, location, helper, metadata, selector,
+            Self::UnwrapNonZero(info) => build_noop::<1, true>(
+                context,
+                registry,
+                entry,
+                location,
+                helper,
+                metadata,
+                &info.signature.param_signatures,
             ),
         }
     }
@@ -723,17 +775,21 @@
     'this: 'ctx,
 {
     #[doc(hidden)]
-    pub(crate) fn results(self) -> impl Iterator<Item = NativeResult<Vec<Value<'ctx, 'this>>>> {
-        self.results.into_iter().enumerate().map(|(branch_idx, x)| {
-            x.into_iter()
-                .enumerate()
-                .map(|(arg_idx, x)| {
-                    x.into_inner().to_native_assert_error(&format!(
-                        "Argument #{arg_idx} of branch {branch_idx} doesn't have a value."
-                    ))
-                })
-                .collect()
-        })
+    pub(crate) fn results(self) -> Result<Vec<Vec<Value<'ctx, 'this>>>> {
+        self.results
+            .into_iter()
+            .enumerate()
+            .map(|(branch_idx, x)| {
+                x.into_iter()
+                    .enumerate()
+                    .map(|(arg_idx, x)| {
+                        x.into_inner().to_native_assert_error(&format!(
+                            "Argument #{arg_idx} of branch {branch_idx} doesn't have a value."
+                        ))
+                    })
+                    .collect()
+            })
+            .collect()
     }
 
     /// Return the initialization block.
@@ -888,4 +944,40 @@
         location,
     ))
 }
+
+fn build_noop<'ctx, 'this, const N: usize, const PROCESS_BUILTINS: bool>(
+    context: &'ctx Context,
+    registry: &ProgramRegistry<CoreType, CoreLibfunc>,
+    entry: &'this Block<'ctx>,
+    location: Location<'ctx>,
+    helper: &LibfuncHelper<'ctx, 'this>,
+    _metadata: &mut MetadataStorage,
+    param_signatures: &[ParamSignature],
+) -> Result<()> {
+    let mut params = Vec::with_capacity(N);
+
+    #[allow(clippy::needless_range_loop)]
+    for i in 0..N {
+        let param_ty = registry.get_type(&param_signatures[i].ty)?;
+        let mut param_val = entry.argument(i)?.into();
+
+        if PROCESS_BUILTINS
+            && param_ty.is_builtin()
+            && !matches!(
+                param_ty,
+                CoreTypeConcrete::BuiltinCosts(_)
+                    | CoreTypeConcrete::Coupon(_)
+                    | CoreTypeConcrete::GasBuiltin(_)
+                    | CoreTypeConcrete::StarkNet(StarkNetTypeConcrete::System(_))
+            )
+        {
+            param_val = increment_builtin_counter(context, entry, location, param_val)?;
+        }
+
+        params.push(param_val);
+    }
+
+    entry.append_operation(helper.br(0, &params, location));
+    Ok(())
+}
 
\ No newline at end of file diff --git a/src/cairo_native/libfuncs/ap_tracking.rs.html b/src/cairo_native/libfuncs/ap_tracking.rs.html deleted file mode 100644 index 60b19e1b6..000000000 --- a/src/cairo_native/libfuncs/ap_tracking.rs.html +++ /dev/null @@ -1,175 +0,0 @@ -ap_tracking.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-
//! # `AP` tracking libfuncs
-//!
-//! Natively compiled code doesn't need `AP` tracking because it has no notion of the `AP` pointer.
-//! Because of this, all `AP`-related libfuncs are no-ops.
-
-use super::LibfuncHelper;
-use crate::{error::Result, metadata::MetadataStorage};
-use cairo_lang_sierra::{
-    extensions::{
-        ap_tracking::ApTrackingConcreteLibfunc,
-        core::{CoreLibfunc, CoreType},
-        lib_func::SignatureOnlyConcreteLibfunc,
-    },
-    program_registry::ProgramRegistry,
-};
-use melior::{
-    ir::{Block, Location},
-    Context,
-};
-
-/// Select and call the correct libfunc builder function from the selector.
-pub fn build<'ctx, 'this>(
-    context: &'ctx Context,
-    registry: &ProgramRegistry<CoreType, CoreLibfunc>,
-    entry: &'this Block<'ctx>,
-    location: Location<'ctx>,
-    helper: &LibfuncHelper<'ctx, 'this>,
-    metadata: &mut MetadataStorage,
-    selector: &ApTrackingConcreteLibfunc,
-) -> Result<()> {
-    match selector {
-        ApTrackingConcreteLibfunc::Revoke(info) => {
-            build_revoke(context, registry, entry, location, helper, metadata, info)
-        }
-        ApTrackingConcreteLibfunc::Enable(info) => {
-            build_enable(context, registry, entry, location, helper, metadata, info)
-        }
-        ApTrackingConcreteLibfunc::Disable(info) => {
-            build_disable(context, registry, entry, location, helper, metadata, info)
-        }
-    }
-}
-
-/// Generate MLIR operations for the `enable_ap_tracking` libfunc.
-pub fn build_enable<'ctx, 'this>(
-    _context: &'ctx Context,
-    _registry: &ProgramRegistry<CoreType, CoreLibfunc>,
-    entry: &'this Block<'ctx>,
-    location: Location<'ctx>,
-    helper: &LibfuncHelper<'ctx, 'this>,
-    _metadata: &mut MetadataStorage,
-    _info: &SignatureOnlyConcreteLibfunc,
-) -> Result<()> {
-    entry.append_operation(helper.br(0, &[], location));
-
-    Ok(())
-}
-
-/// Generate MLIR operations for the `disable_ap_tracking` libfunc.
-pub fn build_disable<'ctx, 'this>(
-    _context: &'ctx Context,
-    _registry: &ProgramRegistry<CoreType, CoreLibfunc>,
-    entry: &'this Block<'ctx>,
-    location: Location<'ctx>,
-    helper: &LibfuncHelper<'ctx, 'this>,
-    _metadata: &mut MetadataStorage,
-    _info: &SignatureOnlyConcreteLibfunc,
-) -> Result<()> {
-    entry.append_operation(helper.br(0, &[], location));
-
-    Ok(())
-}
-
-/// Generate MLIR operations for the `revoke_ap_tracking.` libfunc.
-pub fn build_revoke<'ctx, 'this>(
-    _context: &'ctx Context,
-    _registry: &ProgramRegistry<CoreType, CoreLibfunc>,
-    entry: &'this Block<'ctx>,
-    location: Location<'ctx>,
-    helper: &LibfuncHelper<'ctx, 'this>,
-    _metadata: &mut MetadataStorage,
-    _info: &SignatureOnlyConcreteLibfunc,
-) -> Result<()> {
-    entry.append_operation(helper.br(0, &[], location));
-
-    Ok(())
-}
-
\ No newline at end of file diff --git a/src/cairo_native/libfuncs/bounded_int.rs.html b/src/cairo_native/libfuncs/bounded_int.rs.html index ca97f7ef2..7129f67e2 100644 --- a/src/cairo_native/libfuncs/bounded_int.rs.html +++ b/src/cairo_native/libfuncs/bounded_int.rs.html @@ -764,6 +764,11 @@ 764 765 766 +767 +768 +769 +770 +771
//! # Bounded int libfuncs
 
 use super::LibfuncHelper;
@@ -1508,16 +1513,14 @@
 
 /// Generate MLIR operations for the `bounded_int_wrap_non_zero` libfunc.
 fn build_wrap_non_zero<'ctx, 'this>(
-    _context: &'ctx Context,
+    context: &'ctx Context,
     registry: &ProgramRegistry<CoreType, CoreLibfunc>,
     entry: &'this Block<'ctx>,
     location: Location<'ctx>,
     helper: &LibfuncHelper<'ctx, 'this>,
-    _metadata: &mut MetadataStorage,
+    metadata: &mut MetadataStorage,
     info: &SignatureOnlyConcreteLibfunc,
 ) -> Result<()> {
-    let src_value = entry.argument(0)?.into();
-
     let src_range = registry
         .get_type(&info.signature.param_signatures[0].ty)?
         .integer_range(registry)?;
@@ -1527,7 +1530,14 @@
         "value must not be zero"
     );
 
-    entry.append_operation(helper.br(0, &[src_value], location));
-    Ok(())
+    super::build_noop::<1, true>(
+        context,
+        registry,
+        entry,
+        location,
+        helper,
+        metadata,
+        &info.signature.param_signatures,
+    )
 }
 
\ No newline at end of file diff --git a/src/cairo_native/libfuncs/box.rs.html b/src/cairo_native/libfuncs/box.rs.html index 00f9804fc..6c013865a 100644 --- a/src/cairo_native/libfuncs/box.rs.html +++ b/src/cairo_native/libfuncs/box.rs.html @@ -310,13 +310,6 @@ 310 311 312 -313 -314 -315 -316 -317 -318 -319
//! # Box libfuncs
 //!
 //! A heap allocated value, which is internally a pointer that can't be null.
@@ -362,9 +355,15 @@
         BoxConcreteLibfunc::Unbox(info) => {
             build_unbox(context, registry, entry, location, helper, metadata, info)
         }
-        BoxConcreteLibfunc::ForwardSnapshot(info) => {
-            build_forward_snapshot(context, registry, entry, location, helper, metadata, info)
-        }
+        BoxConcreteLibfunc::ForwardSnapshot(info) => super::build_noop::<1, true>(
+            context,
+            registry,
+            entry,
+            location,
+            helper,
+            metadata,
+            &info.signature.param_signatures,
+        ),
     }
 }
 
@@ -467,19 +466,6 @@
     Ok(())
 }
 
-fn build_forward_snapshot<'ctx, 'this>(
-    _context: &'ctx Context,
-    _registry: &ProgramRegistry<CoreType, CoreLibfunc>,
-    entry: &'this Block<'ctx>,
-    location: Location<'ctx>,
-    helper: &LibfuncHelper<'ctx, 'this>,
-    _metadata: &mut MetadataStorage,
-    _info: &SignatureAndTypeConcreteLibfunc,
-) -> Result<()> {
-    entry.append_operation(helper.br(0, &[entry.argument(0)?.into()], location));
-    Ok(())
-}
-
 #[cfg(test)]
 mod test {
     use crate::{
diff --git a/src/cairo_native/libfuncs/branch_align.rs.html b/src/cairo_native/libfuncs/branch_align.rs.html
deleted file mode 100644
index 033112940..000000000
--- a/src/cairo_native/libfuncs/branch_align.rs.html
+++ /dev/null
@@ -1,67 +0,0 @@
-branch_align.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-
//! # Branch alignment libfunc
-//!
-//! Natively compiled code doesn't need branch alignment because it has no notion of segments.
-//! Because of this, this libfunc is a no-op.
-
-use super::LibfuncHelper;
-use crate::{error::Result, metadata::MetadataStorage};
-use cairo_lang_sierra::{
-    extensions::{
-        core::{CoreLibfunc, CoreType},
-        lib_func::SignatureOnlyConcreteLibfunc,
-    },
-    program_registry::ProgramRegistry,
-};
-use melior::{
-    ir::{Block, Location},
-    Context,
-};
-
-/// Generate MLIR operations for the `branch_align` libfunc.
-pub fn build<'ctx, 'this>(
-    _context: &'ctx Context,
-    _registry: &ProgramRegistry<CoreType, CoreLibfunc>,
-    entry: &'this Block<'ctx>,
-    location: Location<'ctx>,
-    helper: &LibfuncHelper<'ctx, 'this>,
-    _metadata: &mut MetadataStorage,
-    _info: &SignatureOnlyConcreteLibfunc,
-) -> Result<()> {
-    entry.append_operation(helper.br(0, &[], location));
-
-    Ok(())
-}
-
\ No newline at end of file diff --git a/src/cairo_native/libfuncs/circuit.rs.html b/src/cairo_native/libfuncs/circuit.rs.html index f66e4a74a..b784f434b 100644 --- a/src/cairo_native/libfuncs/circuit.rs.html +++ b/src/cairo_native/libfuncs/circuit.rs.html @@ -1362,49 +1362,9 @@ 1362 1363 1364 -1365 -1366 -1367 -1368 -1369 -1370 -1371 -1372 -1373 -1374 -1375 -1376 -1377 -1378 -1379 -1380 -1381 -1382 -1383 -1384 -1385 -1386 -1387 -1388 -1389 -1390 -1391 -1392 -1393 -1394 -1395 -1396 -1397 -1398 -1399 -1400 -1401 -1402 -1403 -1404
//! # Circuit libfuncs
 
-use super::{increment_builtin_counter, increment_builtin_counter_by, LibfuncHelper};
+use super::{increment_builtin_counter_by, LibfuncHelper};
 use crate::{
     error::{Result, SierraAssertError},
     libfuncs::r#struct::build_struct_value,
@@ -1467,11 +1427,20 @@
         CircuitConcreteLibfunc::FailureGuaranteeVerify(info) => build_failure_guarantee_verify(
             context, registry, entry, location, helper, metadata, info,
         ),
-        CircuitConcreteLibfunc::IntoU96Guarantee(info) => {
-            build_into_u96_guarantee(context, registry, entry, location, helper, metadata, info)
-        }
-        CircuitConcreteLibfunc::U96GuaranteeVerify(info) => {
-            build_u96_guarantee_verify(context, registry, entry, location, helper, metadata, info)
+        CircuitConcreteLibfunc::IntoU96Guarantee(SignatureAndTypeConcreteLibfunc {
+            signature,
+            ..
+        })
+        | CircuitConcreteLibfunc::U96GuaranteeVerify(SignatureOnlyConcreteLibfunc { signature }) => {
+            super::build_noop::<1, true>(
+                context,
+                registry,
+                entry,
+                location,
+                helper,
+                metadata,
+                &signature.param_signatures,
+            )
         }
         CircuitConcreteLibfunc::U96LimbsLessThanGuaranteeVerify(info) => {
             build_u96_limbs_less_than_guarantee_verify(
@@ -1529,35 +1498,6 @@
     Ok(())
 }
 
-/// Generate MLIR operations for the `into_u96_guarantee` libfunc.
-#[allow(clippy::too_many_arguments)]
-fn build_into_u96_guarantee<'ctx, 'this>(
-    context: &'ctx Context,
-    registry: &ProgramRegistry<CoreType, CoreLibfunc>,
-    entry: &'this Block<'ctx>,
-    location: Location<'ctx>,
-    helper: &LibfuncHelper<'ctx, 'this>,
-    metadata: &mut MetadataStorage,
-    info: &SignatureAndTypeConcreteLibfunc,
-) -> Result<()> {
-    // input is a BoundedInt<0, 79228162514264337593543950335>
-    let input: Value = entry.argument(0)?.into();
-    // output is a U96Guarantee
-    let output_ty = registry.build_type(
-        context,
-        helper,
-        registry,
-        metadata,
-        &info.branch_signatures()[0].vars[0].ty,
-    )?;
-    // they have the same type (i96)
-    debug_assert_eq!(input.r#type(), output_ty);
-
-    entry.append_operation(helper.br(0, &[input], location));
-
-    Ok(())
-}
-
 /// Generate MLIR operations for the `add_circuit_input` libfunc.
 #[allow(clippy::too_many_arguments)]
 fn build_add_input<'ctx, 'this>(
@@ -2213,26 +2153,6 @@
     Ok(())
 }
 
-/// Generate MLIR operations for the `u96_guarantee_verify` libfunc.
-/// NOOP
-#[allow(clippy::too_many_arguments)]
-fn build_u96_guarantee_verify<'ctx, 'this>(
-    context: &'ctx Context,
-    _registry: &ProgramRegistry<CoreType, CoreLibfunc>,
-    entry: &'this Block<'ctx>,
-    location: Location<'ctx>,
-    helper: &LibfuncHelper<'ctx, 'this>,
-    _metadata: &mut MetadataStorage,
-    _info: &SignatureOnlyConcreteLibfunc,
-) -> Result<()> {
-    let rc = entry.argument(0)?.into();
-    let rc = increment_builtin_counter(context, entry, location, rc)?;
-
-    entry.append_operation(helper.br(0, &[rc], location));
-
-    Ok(())
-}
-
 /// Generate MLIR operations for the `u96_single_limb_less_than_guarantee_verify` libfunc.
 /// NOOP
 #[allow(clippy::too_many_arguments)]
diff --git a/src/cairo_native/libfuncs/mem.rs.html b/src/cairo_native/libfuncs/mem.rs.html
index fd67b753d..75aa2c6d3 100644
--- a/src/cairo_native/libfuncs/mem.rs.html
+++ b/src/cairo_native/libfuncs/mem.rs.html
@@ -102,37 +102,6 @@
 102
 103
 104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
 
//! # Memory-related libfuncs
 //!
 //! Natively compiled code doesn't need this kind of memory tracking because it has no notion of the
@@ -170,39 +139,36 @@
     selector: &MemConcreteLibfunc,
 ) -> Result<()> {
     match selector {
-        MemConcreteLibfunc::StoreTemp(info) => {
-            build_store_temp(context, registry, entry, location, helper, info)
+        MemConcreteLibfunc::AllocLocal(info) => {
+            build_alloc_local(context, registry, entry, location, helper, metadata, info)
         }
         MemConcreteLibfunc::StoreLocal(info) => {
             build_store_local(context, registry, entry, location, helper, metadata, info)
         }
-        MemConcreteLibfunc::FinalizeLocals(info) => {
-            build_finalize_locals(context, registry, entry, location, helper, info)
-        }
-        MemConcreteLibfunc::AllocLocal(info) => {
-            build_alloc_local(context, registry, entry, location, helper, metadata, info)
-        }
-        MemConcreteLibfunc::Rename(info) => {
-            build_rename(context, registry, entry, location, helper, info)
+        MemConcreteLibfunc::FinalizeLocals(info) => super::build_noop::<0, true>(
+            context,
+            registry,
+            entry,
+            location,
+            helper,
+            metadata,
+            &info.signature.param_signatures,
+        ),
+        MemConcreteLibfunc::Rename(SignatureOnlyConcreteLibfunc { signature })
+        | MemConcreteLibfunc::StoreTemp(SignatureAndTypeConcreteLibfunc { signature, .. }) => {
+            super::build_noop::<1, false>(
+                context,
+                registry,
+                entry,
+                location,
+                helper,
+                metadata,
+                &signature.param_signatures,
+            )
         }
     }
 }
 
-/// Generate MLIR operations for the `store_local` libfunc.
-pub fn build_store_local<'ctx, 'this>(
-    _context: &'ctx Context,
-    _registry: &ProgramRegistry<CoreType, CoreLibfunc>,
-    entry: &'this Block<'ctx>,
-    location: Location<'ctx>,
-    helper: &LibfuncHelper<'ctx, 'this>,
-    _metadata: &mut MetadataStorage,
-    _info: &SignatureAndTypeConcreteLibfunc,
-) -> Result<()> {
-    entry.append_operation(helper.br(0, &[entry.argument(1)?.into()], location));
-
-    Ok(())
-}
-
 /// Generate MLIR operations for the `alloc_local` libfunc.
 pub fn build_alloc_local<'ctx, 'this>(
     context: &'ctx Context,
@@ -221,51 +187,23 @@
         &info.branch_signatures()[0].vars[0].ty,
     )?;
 
-    let value_undef = entry.append_op_result(llvm::undef(target_type, location))?;
-
-    entry.append_operation(helper.br(0, &[value_undef], location));
-
-    Ok(())
-}
+    let value = entry.append_op_result(llvm::undef(target_type, location))?;
 
-/// Generate MLIR operations for the `finalize_locals` libfunc.
-pub fn build_finalize_locals<'ctx, 'this>(
-    _context: &'ctx Context,
-    _registry: &ProgramRegistry<CoreType, CoreLibfunc>,
-    entry: &'this Block<'ctx>,
-    location: Location<'ctx>,
-    helper: &LibfuncHelper<'ctx, 'this>,
-    _info: &SignatureOnlyConcreteLibfunc,
-) -> Result<()> {
-    entry.append_operation(helper.br(0, &[], location));
+    entry.append_operation(helper.br(0, &[value], location));
     Ok(())
 }
 
-/// Generate MLIR operations for the `store_temp` libfunc.
-pub fn build_store_temp<'ctx, 'this>(
+/// Generate MLIR operations for the `store_local` libfunc.
+pub fn build_store_local<'ctx, 'this>(
     _context: &'ctx Context,
     _registry: &ProgramRegistry<CoreType, CoreLibfunc>,
     entry: &'this Block<'ctx>,
     location: Location<'ctx>,
     helper: &LibfuncHelper<'ctx, 'this>,
+    _metadata: &mut MetadataStorage,
     _info: &SignatureAndTypeConcreteLibfunc,
 ) -> Result<()> {
-    entry.append_operation(helper.br(0, &[entry.argument(0)?.into()], location));
-
-    Ok(())
-}
-
-/// Generate MLIR operations for the `rename` libfunc.
-pub fn build_rename<'ctx, 'this>(
-    _context: &'ctx Context,
-    _registry: &ProgramRegistry<CoreType, CoreLibfunc>,
-    entry: &'this Block<'ctx>,
-    location: Location<'ctx>,
-    helper: &LibfuncHelper<'ctx, 'this>,
-    _info: &SignatureOnlyConcreteLibfunc,
-) -> Result<()> {
-    entry.append_operation(helper.br(0, &[entry.argument(0)?.into()], location));
-
+    entry.append_operation(helper.br(0, &[entry.argument(1)?.into()], location));
     Ok(())
 }
 
\ No newline at end of file diff --git a/src/cairo_native/libfuncs/nullable.rs.html b/src/cairo_native/libfuncs/nullable.rs.html index 52a66d12d..273b78976 100644 --- a/src/cairo_native/libfuncs/nullable.rs.html +++ b/src/cairo_native/libfuncs/nullable.rs.html @@ -229,32 +229,6 @@ 229 230 231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257
//! # Nullable libfuncs
 //!
 //! Like a Box but it can be null.
@@ -289,17 +263,21 @@
     selector: &NullableConcreteLibfunc,
 ) -> Result<()> {
     match selector {
-        NullableConcreteLibfunc::Null(info) => {
-            build_null(context, registry, entry, location, helper, metadata, info)
-        }
-        NullableConcreteLibfunc::NullableFromBox(info) => {
-            build_nullable_from_box(context, registry, entry, location, helper, metadata, info)
-        }
+        NullableConcreteLibfunc::ForwardSnapshot(info)
+        | NullableConcreteLibfunc::NullableFromBox(info) => super::build_noop::<1, true>(
+            context,
+            registry,
+            entry,
+            location,
+            helper,
+            metadata,
+            &info.signature.param_signatures,
+        ),
         NullableConcreteLibfunc::MatchNullable(info) => {
             build_match_nullable(context, registry, entry, location, helper, metadata, info)
         }
-        NullableConcreteLibfunc::ForwardSnapshot(info) => {
-            build_forward_snapshot(context, registry, entry, location, helper, metadata, info)
+        NullableConcreteLibfunc::Null(info) => {
+            build_null(context, registry, entry, location, helper, metadata, info)
         }
     }
 }
@@ -315,27 +293,10 @@
     _metadata: &mut MetadataStorage,
     _info: &SignatureOnlyConcreteLibfunc,
 ) -> Result<()> {
-    let op =
-        entry.append_operation(ods::llvm::mlir_zero(context, pointer(context, 0), location).into());
-
-    entry.append_operation(helper.br(0, &[op.result(0)?.into()], location));
-
-    Ok(())
-}
-
-/// Generate MLIR operations for the `nullable_from_box` libfunc.
-#[allow(clippy::too_many_arguments)]
-fn build_nullable_from_box<'ctx, 'this>(
-    _context: &'ctx Context,
-    _registry: &ProgramRegistry<CoreType, CoreLibfunc>,
-    entry: &'this Block<'ctx>,
-    location: Location<'ctx>,
-    helper: &LibfuncHelper<'ctx, 'this>,
-    _metadata: &mut MetadataStorage,
-    _info: &SignatureAndTypeConcreteLibfunc,
-) -> Result<()> {
-    entry.append_operation(helper.br(0, &[entry.argument(0)?.into()], location));
+    let value = entry
+        .append_op_result(ods::llvm::mlir_zero(context, pointer(context, 0), location).into())?;
 
+    entry.append_operation(helper.br(0, &[value], location));
     Ok(())
 }
 
@@ -385,19 +346,6 @@
     Ok(())
 }
 
-fn build_forward_snapshot<'ctx, 'this>(
-    _context: &'ctx Context,
-    _registry: &ProgramRegistry<CoreType, CoreLibfunc>,
-    entry: &'this Block<'ctx>,
-    location: Location<'ctx>,
-    helper: &LibfuncHelper<'ctx, 'this>,
-    _metadata: &mut MetadataStorage,
-    _info: &SignatureAndTypeConcreteLibfunc,
-) -> Result<()> {
-    entry.append_operation(helper.br(0, &[entry.argument(0)?.into()], location));
-    Ok(())
-}
-
 #[cfg(test)]
 mod test {
     use crate::{
diff --git a/src/cairo_native/libfuncs/snapshot_take.rs.html b/src/cairo_native/libfuncs/snapshot_take.rs.html
deleted file mode 100644
index 380a319c0..000000000
--- a/src/cairo_native/libfuncs/snapshot_take.rs.html
+++ /dev/null
@@ -1,59 +0,0 @@
-snapshot_take.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-
//! # Snapshot taking libfuncs
-
-use super::LibfuncHelper;
-use crate::{error::Result, metadata::MetadataStorage};
-use cairo_lang_sierra::{
-    extensions::{
-        core::{CoreLibfunc, CoreType},
-        lib_func::SignatureOnlyConcreteLibfunc,
-    },
-    program_registry::ProgramRegistry,
-};
-use melior::{
-    ir::{Block, Location},
-    Context,
-};
-
-/// Generate MLIR operations for the `snapshot_take` libfunc.
-pub fn build<'ctx, 'this>(
-    context: &'ctx Context,
-    registry: &ProgramRegistry<CoreType, CoreLibfunc>,
-    entry: &'this Block<'ctx>,
-    location: Location<'ctx>,
-    helper: &LibfuncHelper<'ctx, 'this>,
-    metadata: &mut MetadataStorage,
-    info: &SignatureOnlyConcreteLibfunc,
-) -> Result<()> {
-    // Taking a snapshot in native is equivalent to duplicating the value.
-    super::dup::build(context, registry, entry, location, helper, metadata, info)
-}
-
\ No newline at end of file diff --git a/src/cairo_native/libfuncs/starknet.rs.html b/src/cairo_native/libfuncs/starknet.rs.html index 8fe17d587..ea034d6ba 100644 --- a/src/cairo_native/libfuncs/starknet.rs.html +++ b/src/cairo_native/libfuncs/starknet.rs.html @@ -3166,104 +3166,6 @@ 3166 3167 3168 -3169 -3170 -3171 -3172 -3173 -3174 -3175 -3176 -3177 -3178 -3179 -3180 -3181 -3182 -3183 -3184 -3185 -3186 -3187 -3188 -3189 -3190 -3191 -3192 -3193 -3194 -3195 -3196 -3197 -3198 -3199 -3200 -3201 -3202 -3203 -3204 -3205 -3206 -3207 -3208 -3209 -3210 -3211 -3212 -3213 -3214 -3215 -3216 -3217 -3218 -3219 -3220 -3221 -3222 -3223 -3224 -3225 -3226 -3227 -3228 -3229 -3230 -3231 -3232 -3233 -3234 -3235 -3236 -3237 -3238 -3239 -3240 -3241 -3242 -3243 -3244 -3245 -3246 -3247 -3248 -3249 -3250 -3251 -3252 -3253 -3254 -3255 -3256 -3257 -3258 -3259 -3260 -3261 -3262 -3263 -3264 -3265 -3266
//! # Starknet libfuncs
 
 use super::LibfuncHelper;
@@ -3312,6 +3214,20 @@
     selector: &StarkNetConcreteLibfunc,
 ) -> Result<()> {
     match selector {
+        StarkNetConcreteLibfunc::ClassHashToFelt252(info)
+        | StarkNetConcreteLibfunc::ContractAddressToFelt252(info)
+        | StarkNetConcreteLibfunc::StorageAddressFromBase(info)
+        | StarkNetConcreteLibfunc::StorageAddressToFelt252(info)
+        | StarkNetConcreteLibfunc::Sha256StateHandleInit(info)
+        | StarkNetConcreteLibfunc::Sha256StateHandleDigest(info) => super::build_noop::<1, true>(
+            context,
+            registry,
+            entry,
+            location,
+            helper,
+            metadata,
+            &info.signature.param_signatures,
+        ),
         StarkNetConcreteLibfunc::CallContract(info) => {
             build_call_contract(context, registry, entry, location, helper, metadata, info)
         }
@@ -3323,9 +3239,6 @@
                 context, registry, entry, location, helper, metadata, info,
             )
         }
-        StarkNetConcreteLibfunc::ClassHashToFelt252(info) => {
-            build_class_hash_to_felt252(context, registry, entry, location, helper, metadata, info)
-        }
         StarkNetConcreteLibfunc::ContractAddressConst(info) => {
             build_contract_address_const(context, registry, entry, location, helper, metadata, info)
         }
@@ -3334,11 +3247,6 @@
                 context, registry, entry, location, helper, metadata, info,
             )
         }
-        StarkNetConcreteLibfunc::ContractAddressToFelt252(info) => {
-            build_contract_address_to_felt252(
-                context, registry, entry, location, helper, metadata, info,
-            )
-        }
         StarkNetConcreteLibfunc::StorageRead(info) => {
             build_storage_read(context, registry, entry, location, helper, metadata, info)
         }
@@ -3353,17 +3261,11 @@
                 context, registry, entry, location, helper, metadata, info,
             )
         }
-        StarkNetConcreteLibfunc::StorageAddressFromBase(info) => build_storage_address_from_base(
-            context, registry, entry, location, helper, metadata, info,
-        ),
         StarkNetConcreteLibfunc::StorageAddressFromBaseAndOffset(info) => {
             build_storage_address_from_base_and_offset(
                 context, registry, entry, location, helper, metadata, info,
             )
         }
-        StarkNetConcreteLibfunc::StorageAddressToFelt252(info) => build_storage_address_to_felt252(
-            context, registry, entry, location, helper, metadata, info,
-        ),
         StarkNetConcreteLibfunc::StorageAddressTryFromFelt252(info) => {
             build_storage_address_try_from_felt252(
                 context, registry, entry, location, helper, metadata, info,
@@ -3375,6 +3277,9 @@
         StarkNetConcreteLibfunc::GetBlockHash(info) => {
             build_get_block_hash(context, registry, entry, location, helper, metadata, info)
         }
+        StarkNetConcreteLibfunc::GetClassHashAt(info) => {
+            build_get_class_hash_at(context, registry, entry, location, helper, metadata, info)
+        }
         StarkNetConcreteLibfunc::GetExecutionInfo(info) => {
             build_get_execution_info(context, registry, entry, location, helper, metadata, info)
         }
@@ -3402,15 +3307,6 @@
         StarkNetConcreteLibfunc::Sha256ProcessBlock(info) => build_sha256_process_block_syscall(
             context, registry, entry, location, helper, metadata, info,
         ),
-        StarkNetConcreteLibfunc::Sha256StateHandleInit(info) => build_sha256_state_handle_init(
-            context, registry, entry, location, helper, metadata, info,
-        ),
-        StarkNetConcreteLibfunc::Sha256StateHandleDigest(info) => build_sha256_state_handle_digest(
-            context, registry, entry, location, helper, metadata, info,
-        ),
-        StarkNetConcreteLibfunc::GetClassHashAt(info) => {
-            build_get_class_hash_at(context, registry, entry, location, helper, metadata, info)
-        }
         #[cfg(feature = "with-cheatcode")]
         StarkNetConcreteLibfunc::Testing(TestingConcreteLibfunc::Cheatcode(info)) => {
             self::testing::build(context, registry, entry, location, helper, metadata, info)
@@ -3655,19 +3551,6 @@
     Ok(())
 }
 
-pub fn build_class_hash_to_felt252<'ctx, 'this>(
-    _context: &'ctx Context,
-    _registry: &ProgramRegistry<CoreType, CoreLibfunc>,
-    entry: &'this Block<'ctx>,
-    location: Location<'ctx>,
-    helper: &LibfuncHelper<'ctx, 'this>,
-    _metadata: &mut MetadataStorage,
-    _info: &SignatureOnlyConcreteLibfunc,
-) -> Result<()> {
-    entry.append_operation(helper.br(0, &[entry.argument(0)?.into()], location));
-    Ok(())
-}
-
 pub fn build_class_hash_try_from_felt252<'ctx, 'this>(
     context: &'ctx Context,
     _registry: &ProgramRegistry<CoreType, CoreLibfunc>,
@@ -3773,19 +3656,6 @@
     Ok(())
 }
 
-pub fn build_contract_address_to_felt252<'ctx, 'this>(
-    _context: &'ctx Context,
-    _registry: &ProgramRegistry<CoreType, CoreLibfunc>,
-    entry: &'this Block<'ctx>,
-    location: Location<'ctx>,
-    helper: &LibfuncHelper<'ctx, 'this>,
-    _metadata: &mut MetadataStorage,
-    _info: &SignatureOnlyConcreteLibfunc,
-) -> Result<()> {
-    entry.append_operation(helper.br(0, &[entry.argument(0)?.into()], location));
-    Ok(())
-}
-
 pub fn build_storage_read<'ctx, 'this>(
     context: &'ctx Context,
     registry: &ProgramRegistry<CoreType, CoreLibfunc>,
@@ -4188,19 +4058,6 @@
     Ok(())
 }
 
-pub fn build_storage_address_from_base<'ctx, 'this>(
-    _context: &'ctx Context,
-    _registry: &ProgramRegistry<CoreType, CoreLibfunc>,
-    entry: &'this Block<'ctx>,
-    location: Location<'ctx>,
-    helper: &LibfuncHelper<'ctx, 'this>,
-    _metadata: &mut MetadataStorage,
-    _info: &SignatureOnlyConcreteLibfunc,
-) -> Result<()> {
-    entry.append_operation(helper.br(0, &[entry.argument(0)?.into()], location));
-    Ok(())
-}
-
 pub fn build_storage_address_from_base_and_offset<'ctx, 'this>(
     _context: &'ctx Context,
     _registry: &ProgramRegistry<CoreType, CoreLibfunc>,
@@ -4221,19 +4078,6 @@
     Ok(())
 }
 
-pub fn build_storage_address_to_felt252<'ctx, 'this>(
-    _context: &'ctx Context,
-    _registry: &ProgramRegistry<CoreType, CoreLibfunc>,
-    entry: &'this Block<'ctx>,
-    location: Location<'ctx>,
-    helper: &LibfuncHelper<'ctx, 'this>,
-    _metadata: &mut MetadataStorage,
-    _info: &SignatureOnlyConcreteLibfunc,
-) -> Result<()> {
-    entry.append_operation(helper.br(0, &[entry.argument(0)?.into()], location));
-    Ok(())
-}
-
 pub fn build_storage_address_try_from_felt252<'ctx, 'this>(
     context: &'ctx Context,
     _registry: &ProgramRegistry<CoreType, CoreLibfunc>,
@@ -5913,46 +5757,6 @@
     Ok(())
 }
 
-///
-/// From the corelib
-/// ```text, no_run
-/// // Initializes a new SHA-256 state handle.
-/// extern fn sha256_state_handle_init(state: Box<[u32; 8]>) -> Sha256StateHandle nopanic;
-/// ```
-pub fn build_sha256_state_handle_init<'ctx, 'this>(
-    _context: &'ctx Context,
-    _registry: &ProgramRegistry<CoreType, CoreLibfunc>,
-    entry: &'this Block<'ctx>,
-    location: Location<'ctx>,
-    helper: &LibfuncHelper<'ctx, 'this>,
-    _metadata: &mut MetadataStorage,
-    _info: &SignatureOnlyConcreteLibfunc,
-) -> Result<()> {
-    let value = entry.argument(0)?.into();
-    entry.append_operation(helper.br(0, &[value], location));
-    Ok(())
-}
-
-///
-/// From the corelib
-/// ```text, no_run
-/// // Initializes a new SHA-256 state handle.
-/// extern fn sha256_state_handle_digest(state: Sha256StateHandle) -> Box<[u32; 8]> nopanic;
-/// ```
-pub fn build_sha256_state_handle_digest<'ctx, 'this>(
-    _context: &'ctx Context,
-    _registry: &ProgramRegistry<CoreType, CoreLibfunc>,
-    entry: &'this Block<'ctx>,
-    location: Location<'ctx>,
-    helper: &LibfuncHelper<'ctx, 'this>,
-    _metadata: &mut MetadataStorage,
-    _info: &SignatureOnlyConcreteLibfunc,
-) -> Result<()> {
-    let value = entry.argument(0)?.into();
-    entry.append_operation(helper.br(0, &[value], location));
-    Ok(())
-}
-
 pub fn build_sha256_process_block_syscall<'ctx, 'this>(
     context: &'ctx Context,
     registry: &ProgramRegistry<CoreType, CoreLibfunc>,
diff --git a/src/cairo_native/libfuncs/unconditional_jump.rs.html b/src/cairo_native/libfuncs/unconditional_jump.rs.html
deleted file mode 100644
index c2910ab49..000000000
--- a/src/cairo_native/libfuncs/unconditional_jump.rs.html
+++ /dev/null
@@ -1,61 +0,0 @@
-unconditional_jump.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-
//! # Unconditional jump libfunc
-
-use super::LibfuncHelper;
-use crate::{error::Result, metadata::MetadataStorage};
-use cairo_lang_sierra::{
-    extensions::{
-        core::{CoreLibfunc, CoreType},
-        lib_func::SignatureOnlyConcreteLibfunc,
-    },
-    program_registry::ProgramRegistry,
-};
-use melior::{
-    ir::{Block, Location},
-    Context,
-};
-
-/// Generate MLIR operations for the `jump` libfunc.
-pub fn build<'ctx>(
-    _context: &'ctx Context,
-    _registry: &ProgramRegistry<CoreType, CoreLibfunc>,
-    entry: &Block<'ctx>,
-    location: Location<'ctx>,
-    helper: &LibfuncHelper<'ctx, '_>,
-    _metadata: &mut MetadataStorage,
-    _info: &SignatureOnlyConcreteLibfunc,
-) -> Result<()> {
-    entry.append_operation(helper.br(0, &[], location));
-
-    Ok(())
-}
-
\ No newline at end of file diff --git a/src/cairo_native/libfuncs/unwrap_non_zero.rs.html b/src/cairo_native/libfuncs/unwrap_non_zero.rs.html deleted file mode 100644 index 5ed675ff3..000000000 --- a/src/cairo_native/libfuncs/unwrap_non_zero.rs.html +++ /dev/null @@ -1,61 +0,0 @@ -unwrap_non_zero.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-
//! # Non-zero unwrapping libfuncs
-
-use super::LibfuncHelper;
-use crate::{error::Result, metadata::MetadataStorage};
-use cairo_lang_sierra::{
-    extensions::{
-        core::{CoreLibfunc, CoreType},
-        lib_func::SignatureOnlyConcreteLibfunc,
-    },
-    program_registry::ProgramRegistry,
-};
-use melior::{
-    ir::{Block, Location},
-    Context,
-};
-
-/// Generate MLIR operations for the `unwrap_non_zero` libfunc.
-pub fn build<'ctx, 'this>(
-    _context: &'ctx Context,
-    _registry: &ProgramRegistry<CoreType, CoreLibfunc>,
-    entry: &'this Block<'ctx>,
-    location: Location<'ctx>,
-    helper: &LibfuncHelper<'ctx, 'this>,
-    _metadata: &mut MetadataStorage,
-    _info: &SignatureOnlyConcreteLibfunc,
-) -> Result<()> {
-    entry.append_operation(helper.br(0, &[entry.argument(0)?.into()], location));
-
-    Ok(())
-}
-
\ No newline at end of file