@@ -476,6 +476,7 @@ function optimization_passes(;
476
476
dus_to_concat:: Bool = false ,
477
477
recognize_comms:: Bool = true ,
478
478
lower_comms:: Bool = true ,
479
+ max_constant_threshold:: Int = 1024 ,
479
480
)
480
481
transform_passes_list = [
481
482
" patterns=compare_op_canon<16>" ,
@@ -516,8 +517,8 @@ function optimization_passes(;
516
517
" cse_neg<16>" ,
517
518
" cse_abs<16>" ,
518
519
" cse_concatenate<16>" ,
519
- " concatenate_op_canon<16>(1024 )" ,
520
- " select_op_canon<16>(1024 )" ,
520
+ " concatenate_op_canon<16>($max_constant_threshold )" ,
521
+ " select_op_canon<16>($max_constant_threshold )" ,
521
522
" add_simplify<16>" ,
522
523
" sub_simplify<16>" ,
523
524
" and_simplify<16>" ,
@@ -531,6 +532,9 @@ function optimization_passes(;
531
532
" div_simplify<16>" ,
532
533
" rem_simplify<16>" ,
533
534
" pow_simplify<16>" ,
535
+ " simplify_extend<16>" ,
536
+ " simplify_wrap<16>" ,
537
+ " simplify_rotate<16>" ,
534
538
" sqrt_simplify<16>" ,
535
539
" cos_simplify<16>" ,
536
540
" sin_simplify<16>" ,
@@ -551,15 +555,16 @@ function optimization_passes(;
551
555
" reduce_to_reshape<16>" ,
552
556
" broadcast_to_reshape<16>" ,
553
557
" gather_simplify<16>" ,
554
- " iota_simplify<16>(1024)" ,
555
- " broadcast_in_dim_simplify<16>(1024)" ,
558
+ " slice_internal" ,
559
+ " iota_simplify<16>($max_constant_threshold )" ,
560
+ " broadcast_in_dim_simplify<16>($max_constant_threshold )" ,
556
561
" convert_concat<1>" ,
557
562
" dynamic_update_to_concat<1>" ,
558
563
" slice_of_dynamic_update<1>" ,
559
564
" slice_elementwise<1>" ,
560
565
" slice_pad<1>" ,
561
566
" dot_reshape_dot<1>" ,
562
- " concat_const_prop<1>" ,
567
+ " concat_const_prop<1>( $max_constant_threshold ) " ,
563
568
" concat_fuse<1>" ,
564
569
" pad_reshape_pad<1>" ,
565
570
" pad_pad<1>" ,
@@ -711,6 +716,7 @@ function optimization_passes(;
711
716
712
717
if WHILE_CONCAT[]
713
718
push! (transform_passes_list, " while_concat" )
719
+ push! (transform_passes_list, " while_wrap" )
714
720
end
715
721
716
722
if dus_to_concat
0 commit comments