|
|
@@ -19,16 +19,17 @@ open Types
|
|
|
open Util
|
|
|
|
|
|
let is_const = function
|
|
|
- | Const _
|
|
|
- | VarUse (_, None, _) -> true
|
|
|
- | _ -> false
|
|
|
+ | Const _ -> true
|
|
|
+ | VarUse (dec, None, _) -> is_const_id (nameof dec)
|
|
|
+ | Var (name, _, _) -> is_const_id name
|
|
|
+ | _ -> false
|
|
|
|
|
|
(* Play-it-safe side effect analysis: only return true for variables and
|
|
|
* constants, since these are targeted in arithmetic simplification (in
|
|
|
* particular targeting array indices that can be simplified after array
|
|
|
* dimension reduction). *)
|
|
|
let no_side_effect = function
|
|
|
- | VarUse _ | Const _ | Var _ -> true
|
|
|
+ | Const _ | VarUse _ | Var _ -> true
|
|
|
| _ -> false
|
|
|
|
|
|
(* Redefine integer operators within this module since they are only used on
|