@@ -11,12 +11,13 @@ use crate::extraction_utils::{get_air_metrics, AirWidthsDiff, OriginalAirs, Orig
1111use crate :: instruction_formatter:: openvm_instruction_formatter;
1212use crate :: memory_bus_interaction:: OpenVmMemoryBusInteraction ;
1313use crate :: powdr_extension:: chip:: PowdrAir ;
14+ use crate :: program:: Prog ;
1415use crate :: utils:: UnsupportedOpenVmReferenceError ;
1516use crate :: OriginalCompiledProgram ;
1617use crate :: { CompiledProgram , SpecializedConfig } ;
1718use itertools:: Itertools ;
1819use openvm_instructions:: instruction:: Instruction as OpenVmInstruction ;
19- use openvm_instructions:: program:: { Program as OpenVmProgram , DEFAULT_PC_STEP } ;
20+ use openvm_instructions:: program:: DEFAULT_PC_STEP ;
2021use openvm_instructions:: VmOpcode ;
2122use openvm_stark_backend:: {
2223 interaction:: SymbolicInteraction ,
@@ -26,7 +27,7 @@ use openvm_stark_sdk::p3_baby_bear::BabyBear;
2627use powdr_autoprecompiles:: adapter:: {
2728 Adapter , AdapterApc , AdapterApcWithStats , AdapterVmConfig , ApcWithStats , PgoAdapter ,
2829} ;
29- use powdr_autoprecompiles:: blocks:: { BasicBlock , Instruction , Program } ;
30+ use powdr_autoprecompiles:: blocks:: { BasicBlock , Instruction } ;
3031use powdr_autoprecompiles:: evaluation:: { evaluate_apc, EvaluationResult } ;
3132use powdr_autoprecompiles:: expression:: try_convert;
3233use powdr_autoprecompiles:: pgo:: { ApcCandidateJsonExport , Candidate , KnapsackItem } ;
@@ -75,16 +76,6 @@ impl<'a> Adapter for BabyBearOpenVmApcAdapter<'a> {
7576 }
7677}
7778
78- /// A newtype wrapper around `OpenVmProgram` to implement the `Program` trait.
79- /// This is necessary because we cannot implement a foreign trait for a foreign type.
80- pub struct Prog < ' a , F > ( pub & ' a OpenVmProgram < F > ) ;
81-
82- impl < ' a , F > From < & ' a OpenVmProgram < F > > for Prog < ' a , F > {
83- fn from ( program : & ' a OpenVmProgram < F > ) -> Self {
84- Prog ( program)
85- }
86- }
87-
8879/// A newtype wrapper around `OpenVmInstruction` to implement the `Instruction` trait.
8980/// This is necessary because we cannot implement a foreign trait for a foreign type.
9081#[ derive( Clone , Serialize , Deserialize ) ]
@@ -115,29 +106,6 @@ impl<F: PrimeField32> Instruction<F> for Instr<F> {
115106 }
116107}
117108
118- impl < ' a , F : PrimeField32 > Program < Instr < F > > for Prog < ' a , F > {
119- fn base_pc ( & self ) -> u64 {
120- self . 0 . pc_base as u64
121- }
122-
123- fn pc_step ( & self ) -> u32 {
124- DEFAULT_PC_STEP
125- }
126-
127- fn instructions ( & self ) -> Box < dyn Iterator < Item = Instr < F > > + ' _ > {
128- Box :: new (
129- self . 0
130- . instructions_and_debug_infos
131- . iter ( )
132- . filter_map ( |x| x. as_ref ( ) . map ( |i| Instr ( i. 0 . clone ( ) ) ) ) ,
133- )
134- }
135-
136- fn length ( & self ) -> u32 {
137- self . 0 . instructions_and_debug_infos . len ( ) as u32
138- }
139- }
140-
141109pub fn customize < ' a , P : PgoAdapter < Adapter = BabyBearOpenVmApcAdapter < ' a > > > (
142110 original_program : OriginalCompiledProgram ,
143111 config : PowdrConfig ,
0 commit comments