Commit d259e79b authored by John van Groningen's avatar John van Groningen
Browse files

add fusion to 'Module Options' dialog

parent e5008729
...@@ -775,6 +775,7 @@ where ...@@ -775,6 +775,7 @@ where
, ("Reuse Unique Nodes",Nothing,toMark ini.reuseUniqueNodes,noPS (\l->{l & reuseUniqueNodes = not l.reuseUniqueNodes})) , ("Reuse Unique Nodes",Nothing,toMark ini.reuseUniqueNodes,noPS (\l->{l & reuseUniqueNodes = not l.reuseUniqueNodes}))
, ("Never Time Profile",Nothing,toMark ini.neverTimeProfile,noPS (\l->{l & neverTimeProfile = not l.neverTimeProfile})) , ("Never Time Profile",Nothing,toMark ini.neverTimeProfile,noPS (\l->{l & neverTimeProfile = not l.neverTimeProfile}))
// , ("Never Memory Profile",Nothing,toMark ini.neverMemoryProfile,noPS (\l->{l & neverMemoryProfile = not l.neverMemoryProfile})) // , ("Never Memory Profile",Nothing,toMark ini.neverMemoryProfile,noPS (\l->{l & neverMemoryProfile = not l.neverMemoryProfile}))
, ("Fusion (Experimental)",Nothing,toMark ini.fusion,noPS (\l->{l & fusion = not l.fusion}))
] ]
(Columns 1) (Columns 1)
[ ControlPos (Left,zero) [ ControlPos (Left,zero)
......
...@@ -16,6 +16,7 @@ from PmDirCache import :: DirCache ...@@ -16,6 +16,7 @@ from PmDirCache import :: DirCache
, abcBeVerbose :: !Bool //--> now abused for -exl flag , abcBeVerbose :: !Bool //--> now abused for -exl flag
, abcGenerateComments :: !Bool , abcGenerateComments :: !Bool
, abcReuseUniqueNodes :: !Bool , abcReuseUniqueNodes :: !Bool
, abcFusion :: !Bool
} }
DefaultABCOptions :: ABCOptions DefaultABCOptions :: ABCOptions
......
...@@ -27,6 +27,7 @@ from StdLibMisc import :: Date{..}, :: Time{..} ...@@ -27,6 +27,7 @@ from StdLibMisc import :: Date{..}, :: Time{..}
, abcBeVerbose :: !Bool , abcBeVerbose :: !Bool
, abcGenerateComments :: !Bool , abcGenerateComments :: !Bool
, abcReuseUniqueNodes :: !Bool , abcReuseUniqueNodes :: !Bool
, abcFusion :: !Bool
} }
DefaultABCOptions :: ABCOptions; DefaultABCOptions :: ABCOptions;
...@@ -38,6 +39,7 @@ DefaultABCOptions = ...@@ -38,6 +39,7 @@ DefaultABCOptions =
, abcBeVerbose = False , abcBeVerbose = False
, abcGenerateComments = False , abcGenerateComments = False
, abcReuseUniqueNodes = False , abcReuseUniqueNodes = False
, abcFusion = False
} }
//-- abc file handling //-- abc file handling
...@@ -60,8 +62,10 @@ NoTimeProfileMask :== 5; ...@@ -60,8 +62,10 @@ NoTimeProfileMask :== 5;
VerboseMask :== 6; VerboseMask :== 6;
WarningsMask :== 7; WarningsMask :== 7;
SystemMask :== 8; SystemMask :== 8;
FusionOffset :== 9;
NrOfOptions :== 9; MinimumNrOfOptions :== 9;
NrOfOptions :== 10;
Combined :: !Pathname !DATE !ABCCache !Files -> (!((!Bool, !Bool, !Int, !ABCOptions),(!List Modulename, !Maybe ModuleDate, !List ModuleDate, !List LinkObjFileName, !List LinkLibraryName),!ABCCache),!Files) Combined :: !Pathname !DATE !ABCCache !Files -> (!((!Bool, !Bool, !Int, !ABCOptions),(!List Modulename, !Maybe ModuleDate, !List ModuleDate, !List LinkObjFileName, !List LinkLibraryName),!ABCCache),!Files)
Combined path date abccache files Combined path date abccache files
...@@ -113,9 +117,15 @@ Read_Version_and_Options file ...@@ -113,9 +117,15 @@ Read_Version_and_Options file
where where
Find_Version_and_Options :: !String -> (!Bool,!Bool,!Bool,!Int,!ABCOptions); Find_Version_and_Options :: !String -> (!Bool,!Bool,!Bool,!Int,!ABCOptions);
Find_Version_and_Options str Find_Version_and_Options str
| match_endinfo < len_str = (True,False,False,-1,DefaultABCOptions); | match_endinfo < len_str
| match_options - start`` == NrOfOptions = (True,sys,stack_seq,version,abcOptions); = (True,False,False,-1,DefaultABCOptions);
| match_options - start`` < MinimumNrOfOptions
= (True,False,False,-1,DefaultABCOptions); = (True,False,False,-1,DefaultABCOptions);
# version = SubStringToInt 0 start` (dec match_version) str;
abcOptions = (StringToCompilerOptions start`` match_options str);
stack_seq = ProjectABCFile start`` str;
sys = SystemABCFile start`` str;
= (True,sys,stack_seq,version,abcOptions);
where where
len_str = size str; len_str = size str;
start = SkipSpaces 0 len_str str; start = SkipSpaces 0 len_str str;
...@@ -127,20 +137,18 @@ where ...@@ -127,20 +137,18 @@ where
match_version = SkipDigits start` len_str str; match_version = SkipDigits start` len_str str;
start`` = SkipSpaces match_version len_str str; start`` = SkipSpaces match_version len_str str;
match_options = SkipBits start`` len_str str; match_options = SkipBits start`` len_str str;
version = SubStringToInt 0 start` (dec match_version) str;
abcOptions = (StringToCompilerOptions start`` str);
stack_seq = ProjectABCFile start`` str;
sys = SystemABCFile start`` str;
StringToCompilerOptions :: !Int !String -> ABCOptions; StringToCompilerOptions :: !Int !Int !String -> ABCOptions;
StringToCompilerOptions start opt StringToCompilerOptions start end opt
= { abcMemoryProfile = not (opt .[start+NoMemoryProfileMask] == '1'), = { abcMemoryProfile = not (opt.[start+NoMemoryProfileMask] == '1'),
abcTimeProfile = not (opt .[start+NoTimeProfileMask] == '1'), abcTimeProfile = not (opt.[start+NoTimeProfileMask] == '1'),
abcStrictnessAnalysis = opt .[start+StrictnessMask] == '1', abcStrictnessAnalysis = opt .[start+StrictnessMask] == '1',
abcGiveWarnings = opt .[start+WarningsMask] == '1', abcGiveWarnings = opt .[start+WarningsMask] == '1',
abcBeVerbose = opt .[start+VerboseMask] == '1', abcBeVerbose = opt .[start+VerboseMask] == '1',
abcGenerateComments = opt .[start+DebugMask] == '1', abcGenerateComments = opt .[start+DebugMask] == '1',
abcReuseUniqueNodes = not (opt.[start+DontReuseUniqueNodesMask] == '1') }; abcReuseUniqueNodes = not (opt.[start+DontReuseUniqueNodesMask] == '1'),
abcFusion = start+FusionOffset<end && opt.[start+FusionOffset]=='1'
};
ProjectABCFile :: !Int !String -> Bool; ProjectABCFile :: !Int !String -> Bool;
ProjectABCFile start opt = opt .[start+ParallelMask] == '0'; ProjectABCFile start opt = opt .[start+ParallelMask] == '0';
...@@ -521,37 +529,18 @@ where ...@@ -521,37 +529,18 @@ where
patchLine :: {#Char} -> (Bool, {#Char}) patchLine :: {#Char} -> (Bool, {#Char})
patchLine line patchLine line
# (found, offset) = findOptionStringOffset line
| found | found
/* sanity checks ...
| abcNoMemoryProfile <> '0' && abcNoMemoryProfile <> '1'
= (False, line) ->> abcPath +++ " incorrect memory offset\n"
| abcNoTimeProfile <> '0' && abcNoTimeProfile <> '1'
= (False, line) ->> abcPath +++ " incorrect time offset\n"
| /*(abcNoMemoryProfile == '0') == memoryProfile &&*/ (abcNoTimeProfile == '0') == timeProfile
= (False, line) ->> abcPath +++ " unnecessary patch\n"
... sanity checks */
// otherwise
= (found, {copy line & /*[offset+NoMemoryProfileMask] = if memoryProfile '0' '1',*/ = (found, {copy line & /*[offset+NoMemoryProfileMask] = if memoryProfile '0' '1',*/
[offset+NoTimeProfileMask] = if timeProfile '0' '1'}) [offset+NoTimeProfileMask] = if timeProfile '0' '1'})
// | otherwise
= (False, line) = (False, line)
where
(found, offset)
= findOptionStringOffset line
/* sanity checks ...
abcNoMemoryProfile
= line.[offset+NoMemoryProfileMask]
abcNoTimeProfile
= line.[offset+NoTimeProfileMask]
... sanity checks */
copy array copy array
= {el \\ el <-: array} = {el \\ el <-: array}
findOptionStringOffset :: {#Char} -> (Bool, Int) findOptionStringOffset :: {#Char} -> (Bool, Int)
findOptionStringOffset string findOptionStringOffset string
= (offset+NrOfOptions < stringLength, offset) = (offset+MinimumNrOfOptions < stringLength, offset)
where where
versionString = toString version versionString = toString version
versionSize = size versionString versionSize = size versionString
......
...@@ -19,6 +19,7 @@ instance fromString ListTypes ...@@ -19,6 +19,7 @@ instance fromString ListTypes
, bv :: !Bool // be verbose , bv :: !Bool // be verbose
, gc :: !Bool // generate commented abc-code , gc :: !Bool // generate commented abc-code
, reuseUniqueNodes :: !Bool , reuseUniqueNodes :: !Bool
, fusion :: !Bool
} }
DefaultCompilerOptions :: CompilerOptions DefaultCompilerOptions :: CompilerOptions
...@@ -72,6 +72,7 @@ where ...@@ -72,6 +72,7 @@ where
, bv :: !Bool // be verbose , bv :: !Bool // be verbose
, gc :: !Bool // generate comments , gc :: !Bool // generate comments
, reuseUniqueNodes :: !Bool // reuse unique nodes , reuseUniqueNodes :: !Bool // reuse unique nodes
, fusion :: !Bool
} }
DefaultCompilerOptions :: CompilerOptions DefaultCompilerOptions :: CompilerOptions
...@@ -85,5 +86,6 @@ DefaultCompilerOptions = ...@@ -85,5 +86,6 @@ DefaultCompilerOptions =
, bv = True , bv = True
, gc = False , gc = False
, reuseUniqueNodes = True , reuseUniqueNodes = True
, fusion = False
} }
...@@ -1413,18 +1413,20 @@ check_module_options modname info=:{version,abcOptions} co mp tp expectedEagerOr ...@@ -1413,18 +1413,20 @@ check_module_options modname info=:{version,abcOptions} co mp tp expectedEagerOr
= (False,"["+++modname+++".icl,]: .abc out of date, different abc version.") = (False,"["+++modname+++".icl,]: .abc out of date, different abc version.")
| abcOptions.abcBeVerbose <> expectedBeVerbose | abcOptions.abcBeVerbose <> expectedBeVerbose
= (False,"["+++modname+++".icl,]: .abc out of date, different compiler options. (Dynamics)") = incorrect_option modname "Dynamics"
| abcOptions.abcTimeProfile <> expectedTimeProfile | abcOptions.abcTimeProfile <> expectedTimeProfile
= (False,"["+++modname+++".icl,]: .abc out of date, different compiler options. (Time Profiling)") = incorrect_option modname "Time Profiling"
| abcOptions.abcMemoryProfile <> expectedMemoryProfile // <- is this how we use it now? | abcOptions.abcMemoryProfile <> expectedMemoryProfile // <- is this how we use it now?
= (False,"["+++modname+++".icl,]: .abc out of date, different compiler options. (Heap Profiling)") = incorrect_option modname "Heap Profiling"
| abcOptions.abcStrictnessAnalysis <> expectedStrictnessAnalysis | abcOptions.abcStrictnessAnalysis <> expectedStrictnessAnalysis
= (False,"["+++modname+++".icl,]: .abc out of date, different compiler options. (Strictness Analysis)") = incorrect_option modname "Strictness Analysis"
// || abcOptions.abcGenerateComments <> expectedGenerateComments // <- do we need to regenerate for this? // || abcOptions.abcGenerateComments <> expectedGenerateComments // <- do we need to regenerate for this?
| (expectedGenerateComments && (not abcOptions.abcGenerateComments)) // want comments but don't have | (expectedGenerateComments && (not abcOptions.abcGenerateComments)) // want comments but don't have
= (False,"["+++modname+++".icl,]: .abc out of date, different compiler options. (Generate Comments)") = incorrect_option modname "Generate Comments"
| abcOptions.abcReuseUniqueNodes <> expectedReuseUniqueNodes | abcOptions.abcReuseUniqueNodes <> expectedReuseUniqueNodes
= (False,"["+++modname+++".icl,]: .abc out of date, different compiler options. (Reuse Unique Nodes)") = incorrect_option modname "Reuse Unique Nodes"
| abcOptions.abcFusion<>co.fusion
= incorrect_option modname "Fusion"
= (True,"") = (True,"")
where where
expectedMemoryProfile = expectedEagerOrDynamic || (mp && (not co.neverMemoryProfile)) expectedMemoryProfile = expectedEagerOrDynamic || (mp && (not co.neverMemoryProfile))
...@@ -1434,6 +1436,9 @@ where ...@@ -1434,6 +1436,9 @@ where
expectedGenerateComments = co.gc expectedGenerateComments = co.gc
expectedReuseUniqueNodes = co.reuseUniqueNodes expectedReuseUniqueNodes = co.reuseUniqueNodes
incorrect_option modname option_name
= (False,"["+++modname+++".icl,]: .abc out of date, different compiler options. ("+++option_name+++")")
//-- Generate Phase... //-- Generate Phase...
// Generate code for the designated module. // Generate code for the designated module.
......
...@@ -186,7 +186,8 @@ CompilerOptionsTable = ...@@ -186,7 +186,8 @@ CompilerOptionsTable =
SimpleOption "Warnings" (\a->a.gw) (\v a->{a & gw=v}), SimpleOption "Warnings" (\a->a.gw) (\v a->{a & gw=v}),
SimpleOption "Verbose" (\a->a.bv) (\v a->{a & bv=v}), SimpleOption "Verbose" (\a->a.bv) (\v a->{a & bv=v}),
SimpleOption "ReadableABC" (\a->a.gc) (\v a->{a & gc=v}), SimpleOption "ReadableABC" (\a->a.gc) (\v a->{a & gc=v}),
SimpleOption "ReuseUniqueNodes" (\a->a.reuseUniqueNodes) (\v a->{a & reuseUniqueNodes=v}) SimpleOption "ReuseUniqueNodes" (\a->a.reuseUniqueNodes) (\v a->{a & reuseUniqueNodes=v}),
SimpleOption "Fusion" (\a->a.fusion) (\v a->{a & fusion=v})
} }
CodeGenOptionsTable :: OptionsTable CodeGenOptions CodeGenOptionsTable :: OptionsTable CodeGenOptions
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment