Skip to content

Commit

Permalink
Limit CSE to generating bitvec temps
Browse files Browse the repository at this point in the history
  • Loading branch information
ncough committed Mar 18, 2024
1 parent 8828e86 commit d0c3401
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions libASL/transforms.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1456,10 +1456,13 @@ module CommonSubExprElim = struct
let () = match e with
(* For now, only gather TApply's that we've seen more than once
See eval_prim in value.ml for the list of what that covers. *)
| Expr_TApply(_) ->
if (List.mem e cand_exprs) && not (List.mem e exprs) then
exprs <- e :: exprs
else cand_exprs <- e :: cand_exprs;
| Expr_TApply(FIdent(f,_),_,_) when List.mem f Value.prims_pure ->
(match infer_type e with
| Some (Type_Bits _) ->
if (List.mem e cand_exprs) && not (List.mem e exprs) then
exprs <- e :: exprs
else cand_exprs <- e :: cand_exprs;
| _ -> ())
| _ ->
()
in
Expand Down

0 comments on commit d0c3401

Please sign in to comment.