Skip to content

Commit

Permalink
Fixes:
Browse files Browse the repository at this point in the history
 - Extend vectorizer to visit conditional loops
 - Don't rerun StatefulIntToBits for widening of an integer, it won't actually change anything
 - Add ite size
  • Loading branch information
ncough committed Jul 11, 2024
1 parent f481a22 commit 26bc444
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion libASL/transforms.ml
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,8 @@ module StatefulIntToBits = struct
(* Merge width and sign, but keep new range for range analysis *)
let (w,s,_) = merge_abs i j in
let m = (w,s,interval i) in
{st with changed = true ; ints = Bindings.add v m st.ints}

{st with ints = Bindings.add v m st.ints}
| None ->
{st with changed = true ; ints = Bindings.add v i st.ints}

Expand Down Expand Up @@ -852,6 +853,7 @@ module IntToBits = struct
| FIdent ("SignExtend", 0), [_; Expr_LitInt m], _ -> int_of_string m
| FIdent ("Elem.read", 0), [_; Expr_LitInt m], _ -> int_of_string m
| FIdent ("Elem.set", 0), [Expr_LitInt v;_], _ -> int_of_string v
| FIdent ("ite", 0), [Expr_LitInt n], _ -> int_of_string n
| _ -> failwith @@ "bits_size_of_expr: unhandled " ^ pp_expr e
)
| Expr_Parens e -> bits_size_of_expr vars e
Expand Down Expand Up @@ -2621,6 +2623,10 @@ module LoopClassify = struct
let st' = fixed_point st body in
let sum = loop_summary st' loc in
(acc@sum)
| Stmt_If(c, t, [], f, loc) ->
let t = walk t types env in
let f = walk f types env in
(acc@[Stmt_If(c, t, [], f, loc)])
| _ -> (acc@[stmt])) ([]) s

let parse_sels v =
Expand Down

0 comments on commit 26bc444

Please sign in to comment.