Преглед на файлове

Basic variables uses are now propagated like constants to save stack space

Taddeus Kroes преди 12 години
родител
ревизия
dace7f46a0
променени са 1 файла, в които са добавени 4 реда и са изтрити 1 реда
  1. 4 1
      phases/constprop.ml

+ 4 - 1
phases/constprop.ml

@@ -21,7 +21,10 @@ open Util
 let is_const_name name =
   Str.string_match (Str.regexp "^.+\\$\\$[0-9]+$") name 0
 
-let is_const = function Const _ -> true | _ -> false
+let is_const = function
+  | Const _
+  | VarUse (_, None, _) -> true
+  | _ -> false
 
 (* Play-it-safe side effect analysis: only return true for variables and
  * constants, since these are targeted in arithmetic simplification (in