Skip to content

Commit

Permalink
No need to match and unroll comparison operator type in LoopUnrolling
Browse files Browse the repository at this point in the history
It should always be int.
  • Loading branch information
sim642 committed Feb 20, 2025
1 parent 95e136b commit 35cea1d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/util/loopUnrolling.ml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ let containsInstructions stmt =

let isCompare = function
| Lt | Gt | Le | Ge | Ne -> true (*an loop that test for equality can not be of the type we look for*)
(* TODO: why not Eq? *)
| _ -> false

let loopBody loopStatement = match loopStatement.skind with
Expand Down Expand Up @@ -260,8 +261,8 @@ let findLoopVarAndGoal loopStatement func (op, exp1, exp2) =
end;
| _ -> None

let getLoopVar loopStatement func = function (* TODO: unrolltype? *)
| BinOp (op, exp1, exp2, TInt _) when isCompare op -> findLoopVarAndGoal loopStatement func (op, exp1, exp2)
let getLoopVar loopStatement func = function
| BinOp (op, exp1, exp2, _) when isCompare op -> findLoopVarAndGoal loopStatement func (op, exp1, exp2)
| _ -> None

let getsPointedAt var func =
Expand Down

0 comments on commit 35cea1d

Please sign in to comment.