File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
pydatastructs/linear_data_structures/_backend/cpp/algorithms Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -145,6 +145,32 @@ def _materialize(dtype: str) -> int:
145145 mod = binding .parse_assembly (llvm_ir )
146146 mod .verify ()
147147
148+ pmb = binding .PassManagerBuilder ()
149+ pmb .opt_level = 3
150+ pmb .loop_vectorize = True
151+ pmb .slp_vectorize = True
152+
153+ fpm = binding .create_function_pass_manager (mod )
154+ pm = binding .create_module_pass_manager ()
155+
156+ pm .add_basic_alias_analysis_pass ()
157+ pm .add_type_based_alias_analysis_pass ()
158+ pm .add_instruction_combining_pass ()
159+ pm .add_gvn_pass ()
160+ pm .add_cfg_simplification_pass ()
161+ pm .add_loop_unroll_pass ()
162+ pm .add_loop_unswitch_pass ()
163+
164+ pmb .populate (fpm )
165+ pmb .populate (pm )
166+
167+ fpm .initialize ()
168+ for func in mod .functions :
169+ fpm .run (func )
170+ fpm .finalize ()
171+
172+ pm .run (mod )
173+
148174 engine = binding .create_mcjit_compiler (mod , _target_machine )
149175 engine .finalize_object ()
150176 engine .run_static_constructors ()
You can’t perform that action at this time.
0 commit comments