@@ -238,7 +238,7 @@ let rec inline_function_expression propto adt fim
238238 match kind with
239239 | CompilerInternal _ ->
240240 (d_list, s_list, {e with pattern= FunApp (kind, es)})
241- | UserDefined (fname , suffix ) | StanLib (fname , suffix ) -> (
241+ | UserDefined (fname , suffix ) | StanLib (fname , suffix , _ ) -> (
242242 let suffix, fname' =
243243 match suffix with
244244 | FnLpdf propto' when propto' && propto ->
@@ -252,7 +252,7 @@ let rec inline_function_expression propto adt fim
252252 let fun_kind =
253253 match kind with
254254 | Fun_kind. UserDefined _ -> Fun_kind. UserDefined (fname, suffix)
255- | _ -> StanLib (fname, suffix)
255+ | _ -> StanLib (fname, suffix, AoS )
256256 in
257257 (d_list, s_list, {e with pattern= FunApp (fun_kind, es)})
258258 | Some (rt , args , b ) ->
@@ -388,7 +388,7 @@ let rec inline_function_statement propto adt fim Stmt.Fixed.({pattern; meta}) =
388388 slist_concat_no_loc (d_list @ s_list)
389389 ( match kind with
390390 | CompilerInternal _ -> NRFunApp (kind, es)
391- | UserDefined (s , _ ) | StanLib (s , _ ) -> (
391+ | UserDefined (s , _ ) | StanLib (s , _ , _ ) -> (
392392 match Map. find fim s with
393393 | None -> NRFunApp (kind, es)
394394 | Some (_ , args , b ) ->
@@ -593,8 +593,8 @@ let unroll_loop_one_step_statement _ =
593593 IfElse
594594 ( Expr.Fixed.
595595 { lower with
596- pattern= FunApp ( StanLib ( " Geq__ " , FnPlain ), [upper; lower])
597- }
596+ pattern=
597+ FunApp ( StanLib ( " Geq__ " , FnPlain , SoA ), [upper; lower]) }
598598 , { pattern=
599599 (let body_unrolled =
600600 subst_args_stmt [loopvar] [lower]
@@ -610,7 +610,7 @@ let unroll_loop_one_step_statement _ =
610610 { lower with
611611 pattern=
612612 FunApp
613- ( StanLib (" Plus__" , FnPlain )
613+ ( StanLib (" Plus__" , FnPlain , SoA )
614614 , [lower; Expr.Helpers. loop_bottom] ) } }
615615 ; meta= Location_span. empty }
616616 in
@@ -694,7 +694,7 @@ and accum_any pred b e = b || expr_any pred e
694694
695695let can_side_effect_top_expr (e : Expr.Typed.t ) =
696696 match e.pattern with
697- | FunApp ((UserDefined (_ , FnTarget ) | StanLib (_ , FnTarget)), _ ) -> true
697+ | FunApp ((UserDefined (_ , FnTarget ) | StanLib (_ , FnTarget, _ )), _ ) -> true
698698 | FunApp (CompilerInternal internal_fn , _ ) ->
699699 Internal_fun. can_side_effect internal_fn
700700 | _ -> false
@@ -703,7 +703,7 @@ let cannot_duplicate_expr (e : Expr.Typed.t) =
703703 let pred e =
704704 can_side_effect_top_expr e
705705 || ( match e.pattern with
706- | FunApp ((UserDefined (_ , FnRng ) | StanLib (_ , FnRng)), _ ) -> true
706+ | FunApp ((UserDefined (_ , FnRng ) | StanLib (_ , FnRng, _ )), _ ) -> true
707707 | _ -> false )
708708 || (preserve_stability && UnsizedType. is_autodiffable e.meta.type_)
709709 in
0 commit comments