diff --git a/compiler/supercompile/Supercompile/Drive/Process.hs b/compiler/supercompile/Supercompile/Drive/Process.hs index 5f9dcbd602eb62e3da67ec4c287805db2c08a4a3..c7727b022e0797a89fbdfc914225f6931aaeb95d 100644 --- a/compiler/supercompile/Supercompile/Drive/Process.hs +++ b/compiler/supercompile/Supercompile/Drive/Process.hs @@ -696,7 +696,8 @@ nothingSpeculated = S.empty -- FIXME: if I speculate roughly in dependency order then GHCs inlining heuristics will have more information -- to work with in the reduce invocations speculate :: AlreadySpeculated -> (SCStats, State) -> (AlreadySpeculated, (SCStats, State)) -speculate speculated (stats, (deeds, heap, k, in_e)) = (speculated', (stats', (deeds', heap', k, in_e))) +speculate speculated (stats, state) | not sPECULATION = (speculated, (stats, state)) +speculate speculated (stats, (deeds, heap, k, in_e)) = (speculated', (stats', (deeds', heap', k, in_e))) where (speculated', (stats', deeds', heap')) = speculateHeap speculated (stats, deeds, heap) --type SpecRB = SpecHistory -> SpecM (SpecHistory, Deeds, Heap) diff --git a/compiler/supercompile/Supercompile/Drive/Process1.hs b/compiler/supercompile/Supercompile/Drive/Process1.hs index 09cb6b2b98e703a04005477434bfdd5e5b123139..323b0ae1106e31e77523e03d66418acd23295566 100644 --- a/compiler/supercompile/Supercompile/Drive/Process1.hs +++ b/compiler/supercompile/Supercompile/Drive/Process1.hs @@ -454,7 +454,7 @@ sc' hist speculated state = handlePrint $ (\raise -> check raise) `catchScpM` \g continue hist = do traceRenderScpM "reduce end (continue)" (PrettyDoc (pPrintFullState quietStatePrettiness state')) addStats stats liftM (\(_, deeds, e') -> (deeds, e')) $ split state' (liftPB . sc hist speculated') - where (speculated', (stats, state')) = (if sPECULATION then speculate speculated else ((,) speculated)) $ reduceWithStats state -- TODO: experiment with doing admissability-generalisation on reduced terms. My suspicion is that it won't help, though (such terms are already stuck or non-stuck but loopy: throwing stuff away does not necessarily remove loopiness). + where (speculated', (stats, state')) = speculate speculated $ reduceWithStats state -- TODO: experiment with doing admissability-generalisation on reduced terms. My suspicion is that it won't help, though (such terms are already stuck or non-stuck but loopy: throwing stuff away does not necessarily remove loopiness). memo :: (AlreadySpeculated -> State -> ScpBM (Deeds, Out FVedTerm)) -> AlreadySpeculated -> State -> ScpPM (Deeds, Out FVedTerm)