From 909b0b603384c982290624d5d65fe1e1c57b2921 Mon Sep 17 00:00:00 2001 From: John van Groningen Date: Thu, 1 Feb 2018 11:53:18 +0000 Subject: [PATCH] allow -generic_fusion argument, add bit to .comp directive indicating whether it was passed --- backendC/CleanCompilerSources/cocl.c | 3 +++ backendC/CleanCompilerSources/instructions.c | 6 ++++-- backendC/CleanCompilerSources/settings.c | 1 + backendC/CleanCompilerSources/settings.h | 1 + 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/backendC/CleanCompilerSources/cocl.c b/backendC/CleanCompilerSources/cocl.c index 7a6ebfaf..d4032138 100644 --- a/backendC/CleanCompilerSources/cocl.c +++ b/backendC/CleanCompilerSources/cocl.c @@ -128,6 +128,7 @@ Bool CallCompiler (int argc, char **argv) DoTimeProfiling=False; DoReuseUniqueNodes=False; DoFusion=False; + DoGenericFusion=False; DoDescriptors=False; ExportLocalLabels=False; AddStrictnessToExportedFunctionTypes=False; @@ -192,6 +193,8 @@ Bool CallCompiler (int argc, char **argv) ExportLocalLabels=True; else if (strcmp (argv_i,"-fusion") == 0) DoFusion=True; + else if (strcmp (argv_i,"-generic_fusion") == 0) + DoGenericFusion=True; else if (strcmp (argv_i,"-seft") == 0) AddStrictnessToExportedFunctionTypes=True; else if (strcmp (argv_i,"-dynamics") == 0) diff --git a/backendC/CleanCompilerSources/instructions.c b/backendC/CleanCompilerSources/instructions.c index 39c94871..cc891e0e 100644 --- a/backendC/CleanCompilerSources/instructions.c +++ b/backendC/CleanCompilerSources/instructions.c @@ -55,9 +55,10 @@ static void error_in_function (char *m) #define N_DoFusion 9 #define N_Do64BitArch 10 #define N_Dynamics 11 +#define N_DoGenericFusion 12 #define MINIMUM_N_OPTIONS 9 -#define N_OPTIONS 12 +#define N_OPTIONS 13 static void ConvertOptionsToString (char *optstring) { @@ -79,10 +80,11 @@ static void ConvertOptionsToString (char *optstring) optstring[N_DoWarning] = DoWarning ? '1' : '0'; optstring[N_System] = '0'; - if (DoFusion || ObjectSizes[RealObj]!=2 || Dynamics){ + if (DoFusion || ObjectSizes[RealObj]!=2 || Dynamics || DoGenericFusion){ optstring[N_DoFusion] = DoFusion ? '1' : '0'; optstring[N_Do64BitArch] = ObjectSizes[RealObj]!=2 ? '1' : '0'; optstring[N_Dynamics] = Dynamics ? '1' : '0'; + optstring[N_DoGenericFusion] = DoGenericFusion ? '1' : '0'; optstring[N_OPTIONS]='\0'; } else optstring[MINIMUM_N_OPTIONS]='\0'; diff --git a/backendC/CleanCompilerSources/settings.c b/backendC/CleanCompilerSources/settings.c index 166b53ef..7b466841 100644 --- a/backendC/CleanCompilerSources/settings.c +++ b/backendC/CleanCompilerSources/settings.c @@ -31,6 +31,7 @@ Bool DoTimeProfiling=False; Bool DoReuseUniqueNodes = False; Bool DoFusion = False; +Bool DoGenericFusion = False; Bool OptimizeLazyTupleRecursion=False; Bool OptimizeTailCallModuloCons=True; diff --git a/backendC/CleanCompilerSources/settings.h b/backendC/CleanCompilerSources/settings.h index 678106ee..aa996c95 100644 --- a/backendC/CleanCompilerSources/settings.h +++ b/backendC/CleanCompilerSources/settings.h @@ -29,6 +29,7 @@ extern Bool DoTimeProfiling; extern Bool DoReuseUniqueNodes; extern Bool DoFusion; +extern Bool DoGenericFusion; extern Bool OptimizeLazyTupleRecursion; extern Bool OptimizeTailCallModuloCons; extern Bool WriteModificationTimes; -- GitLab