Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Commit

Permalink
Remove all P related compilation and dependencies, retain HRC as the …
Browse files Browse the repository at this point in the history
…only compiler
  • Loading branch information
Paul H. Liu committed Apr 11, 2017
1 parent bf0ecfa commit 67999f6
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 59 deletions.
1 change: 0 additions & 1 deletion compiler/back-end/back-end.mlb
Expand Up @@ -18,7 +18,6 @@
local
$(SML_LIB)/mlton/sources.mlb
../common/common.mlb
../core-op/core-op.mlb
../mil/mil.mlb
pil.sml
runtime.sml
Expand Down
2 changes: 1 addition & 1 deletion compiler/back-end/mil-to-pil.sml
Expand Up @@ -3263,7 +3263,7 @@ struct
fun genInit (state, env, entry, globals) =
let
(* The runtime needs to know the \core\char\ord name *)
val ord = IM.nameMake (getStm state, Prims.ordString)
val ord = IM.nameMake (getStm state, "ord")
val ord = genName (state, env, ord)
val or = Pil.E.call (Pil.E.variable RT.Name.registerCoreCharOrd, [ord])
val () = addReg1 (state, Pil.S.expr or)
Expand Down
4 changes: 2 additions & 2 deletions compiler/mil/check.sml
Expand Up @@ -1405,11 +1405,11 @@ struct
(* Build the state and environment *)
val s = stateMk ()
val (ord, st) =
((I.nameFromString (symbolTable, Prims.ordString), symbolTable)
((I.nameFromString (symbolTable, "ord"), symbolTable)
handle _ =>
let
val stm = IM.fromExistingAll symbolTable
val ord = IM.nameMake (stm, Prims.ordString)
val ord = IM.nameMake (stm, "ord")
val st = MU.SymbolTableManager.finish stm
in (ord, st)
end)
Expand Down
1 change: 0 additions & 1 deletion compiler/mil/dataflow-analysis.sml
Expand Up @@ -143,7 +143,6 @@ functor MilDataFlowAnalysisF (
structure LS = Identifier.LabelSet
structure LD = Identifier.LabelDict
structure VD = Identifier.VariableDict
structure P = Prims

(*
* local environment structure
Expand Down
1 change: 0 additions & 1 deletion compiler/mil/mil.mlb
Expand Up @@ -19,7 +19,6 @@
local
$(SML_LIB)/mlton/sources.mlb
../common/common.mlb
../core-p/core-p.mlb
prims.sml
mil.sml
prims-utils.sml
Expand Down
2 changes: 1 addition & 1 deletion compiler/mil/parse.sml
Expand Up @@ -1731,7 +1731,7 @@ struct

fun program (config : Config.t) : M.t P.t =
let
val stm = IM.new Prims.ordString
val stm = IM.new "ord"
val state = stateMk stm
val env = envMk config
val includes = P.map (keywordS "Includes:" && P.zeroOrMoreV (includeFileF (state, env)), #2)
Expand Down
12 changes: 7 additions & 5 deletions compiler/mil/profile.sml
Expand Up @@ -209,13 +209,15 @@ functor MilProfilerF (type env
structure BranchProb =
struct

datatype compare = CEq | CNe | CLt | CLe

(* EB: This datatype is imcomplete. However, since it is
* only used by the opcode heuristic and it is not finished yet,
* I decided to keep it in this way until we decide if we need
* or not the opcode heuristic. *)
datatype comparisonType =
None
| IntCmp of Prims.compare * Mil.operand * Mil.operand
| IntCmp of compare * Mil.operand * Mil.operand
| Other (* Other comparisons. *)

datatype info = Helpers of
Expand Down Expand Up @@ -360,15 +362,15 @@ functor MilProfilerF (type env
val OpcodeHeuristic : probabilityHeuristic =
fn (info, n, s1, s2) =>
case getComparison (info, n)
of IntCmp (Prims.CLt, Mil.SVariable _, Mil.SConstant c) =>
of IntCmp (CLt, Mil.SVariable _, Mil.SConstant c) =>
if (isZero (info, c)) then SOME (1.0 - hitRate LHH)
else NONE
| IntCmp (Prims.CLe, Mil.SVariable _, Mil.SConstant c) =>
| IntCmp (CLe, Mil.SVariable _, Mil.SConstant c) =>
if (isZero (info, c)) then SOME (1.0 - hitRate LHH)
else NONE
| IntCmp (Prims.CEq, Mil.SVariable _, Mil.SConstant _) =>
| IntCmp (CEq, Mil.SVariable _, Mil.SConstant _) =>
SOME (1.0 - hitRate LHH)
| IntCmp (Prims.CEq, Mil.SConstant _, Mil.SVariable _) =>
| IntCmp (CEq, Mil.SConstant _, Mil.SVariable _) =>
SOME (1.0 - hitRate LHH)
| _ => NONE

Expand Down
2 changes: 1 addition & 1 deletion compiler/mil/type.sml
Expand Up @@ -651,7 +651,7 @@ struct
val tString =
fn (c, si) =>
let
val ord = M.CName (Prims.getOrd si)
val ord = fail ("tString", "this feature (getting the internal name of ord function) has been removed")
val char = MU.Boxed.t tRat
val sum = POM.Sum.typ (M.TName, Vector.new1 (ord, Vector.new1 char))
val str = OA.varTyp (c, char)
Expand Down
47 changes: 1 addition & 46 deletions hrc-makefile.inc
Expand Up @@ -241,7 +241,7 @@ COMPILER_SRCS = \
COMPILER_STD_OPTS = @MLton -- \
-verbose 1 -runtime 'use-mmap true' \
-codegen native \
-native-split 900000
-native-split 900000 -mlb-path-map /opt/mlton-20130715/sml-lib/mlb-path-map
# The following don't work on 64-bit
# -ieee-fp true -max-heap 800m

Expand Down Expand Up @@ -291,51 +291,6 @@ HASKELL_SRCS = \
compiler/core-hs/core-hs.grm.sml \
compiler/haskell.sml

# keep these in alpabetic order
P_SRCS = \
compiler/core-op/core-op.mlb \
compiler/core-op/core-p.sml \
compiler/core-op/fix-up.sml \
compiler/core-op/layout.sml \
compiler/core-op/parse.sml \
compiler/core-op/prims.sml \
compiler/core-op/stats.sml \
compiler/core-op/utils.sml \
compiler/core-p/common.sml \
compiler/core-p/common-utils.sml \
compiler/core-p/core-p.mlb \
compiler/core-p/linear.sml \
compiler/core-p/linear-analyse.sml \
compiler/core-p/linear-dce.sml \
compiler/core-p/linear-free-variables.sml \
compiler/core-p/linear-layout.sml \
compiler/core-p/linear-optimise.sml \
compiler/core-p/linear-simplify.sml \
compiler/core-p/linear-sink1.sml \
compiler/core-p/linear-sink2.sml \
compiler/core-p/linear-stats.sml \
compiler/core-p/linear-type.sml \
compiler/core-p/linear-utils.sml \
compiler/core-p/natives.sml \
compiler/core-p/parse.sml \
compiler/core-p/prims.sml \
compiler/core-p/raw-layout.sml \
compiler/core-p/raw-stats.sml \
compiler/core-p/raw-to-linear.sml \
compiler/core-p/raw-utils.sml \
compiler/core-p/raw.sml \
compiler/core-p/type.sml \
compiler/hil/analyse.sml \
compiler/hil/check.sml \
compiler/hil/dce.sml \
compiler/hil/free-vars.sml \
compiler/hil/hil.mlb \
compiler/hil/hil.sml \
compiler/hil/layout.sml \
compiler/hil/optimise.sml \
compiler/hil/simplifier.sml \
compiler/hil/utils.sml

# make-version
make-version: $(BINDIR)/make-version.sh
sh $(BINDIR)/make-version.sh "$(HRC_VERSION)" compiler/version.sml $(HRC_PREFIX)
Expand Down

0 comments on commit 67999f6

Please sign in to comment.