From 1eaf745c5e4e32784a8e919b1a82d4d725036214 Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Fri, 10 May 2019 14:46:05 +0200 Subject: Added options -fcommon and -fno-common (#164) The option -fcommon controls whether uninitialized global variables are placed in the COMMON section. If the option is given in the negated form, -fno-common, variables are not placed in the COMMON section. They are placed in the same sections as gcc does. If the variables are not placed in the COMMON section merging of tentative definitions is inhibited and multiple definitions lead to a linker error, as it does for gcc. --- driver/Clflags.ml | 1 + 1 file changed, 1 insertion(+) (limited to 'driver/Clflags.ml') diff --git a/driver/Clflags.ml b/driver/Clflags.ml index a886ee9b..fc12863d 100644 --- a/driver/Clflags.ml +++ b/driver/Clflags.ml @@ -31,6 +31,7 @@ let option_falignfunctions = ref (None: int option) let option_falignbranchtargets = ref 0 let option_faligncondbranchs = ref 0 let option_finline_asm = ref false +let option_fcommon = ref true let option_mthumb = ref (Configuration.model = "armv7m") let option_Osize = ref false let option_finline = ref true -- cgit From 66ee59d3dc8a861b468cfaf0ff46fc71dfb8fec2 Mon Sep 17 00:00:00 2001 From: David Monniaux Date: Sat, 11 May 2019 21:54:18 +0200 Subject: option -faddx (off by default until questions cleared) --- driver/Clflags.ml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'driver/Clflags.ml') diff --git a/driver/Clflags.ml b/driver/Clflags.ml index b1afab6f..651d644e 100644 --- a/driver/Clflags.ml +++ b/driver/Clflags.ml @@ -70,4 +70,5 @@ let use_standard_headers = ref Configuration.has_standard_headers let option_fglobaladdrtmp = ref false let option_fglobaladdroffset = ref false let option_fxsaddr = ref true -let option_coalesce_mem = ref true +let option_faddx = ref false +let option_fcoalesce_mem = ref true -- cgit From 95938a8732b572d61955b1de8c49362c9e162640 Mon Sep 17 00:00:00 2001 From: Xavier Leroy Date: Fri, 31 May 2019 19:15:19 +0200 Subject: If-conversion optimization Extends the instruction selection pass with an if-conversion optimization: some if/then/else statements are converted into "select" operations, which in turn can be compiled down to branchless instruction sequences if the target architecture supports them. The statements that are converted are of the form if (cond) { x = a1; } else { x = a2; } if (cond) { x = a1; } if (cond) { /*skip*/; } else { x = a2; } where a1, a2 are "safe" expressions, containing no operations that can fail at run-time, such as memory loads or integer divisions. A heuristic in backend/Selectionaux.ml controls when the optimization occurs, depending on command-line flags and the complexity of the "then" and "else" branches. --- driver/Clflags.ml | 2 ++ 1 file changed, 2 insertions(+) (limited to 'driver/Clflags.ml') diff --git a/driver/Clflags.ml b/driver/Clflags.ml index fc12863d..d27871ef 100644 --- a/driver/Clflags.ml +++ b/driver/Clflags.ml @@ -27,6 +27,8 @@ let option_ftailcalls = ref true let option_fconstprop = ref true let option_fcse = ref true let option_fredundancy = ref true +let option_fifconversion = ref true +let option_ffavor_branchless = ref false let option_falignfunctions = ref (None: int option) let option_falignbranchtargets = ref 0 let option_faligncondbranchs = ref 0 -- cgit From 8e3a73448c5ddfa4be3871d7f4fd80281a7549f4 Mon Sep 17 00:00:00 2001 From: Xavier Leroy Date: Fri, 31 May 2019 19:15:19 +0200 Subject: If-conversion optimization Extends the instruction selection pass with an if-conversion optimization: some if/then/else statements are converted into "select" operations, which in turn can be compiled down to branchless instruction sequences if the target architecture supports them. The statements that are converted are of the form if (cond) { x = a1; } else { x = a2; } if (cond) { x = a1; } if (cond) { /*skip*/; } else { x = a2; } where a1, a2 are "safe" expressions, containing no operations that can fail at run-time, such as memory loads or integer divisions. A heuristic in backend/Selectionaux.ml controls when the optimization occurs, depending on command-line flags and the complexity of the "then" and "else" branches. --- driver/Clflags.ml | 2 ++ 1 file changed, 2 insertions(+) (limited to 'driver/Clflags.ml') diff --git a/driver/Clflags.ml b/driver/Clflags.ml index fc12863d..d27871ef 100644 --- a/driver/Clflags.ml +++ b/driver/Clflags.ml @@ -27,6 +27,8 @@ let option_ftailcalls = ref true let option_fconstprop = ref true let option_fcse = ref true let option_fredundancy = ref true +let option_fifconversion = ref true +let option_ffavor_branchless = ref false let option_falignfunctions = ref (None: int option) let option_falignbranchtargets = ref 0 let option_faligncondbranchs = ref 0 -- cgit From ea6807fdaeaa2e46e1c7471c91056fdc4736cc2f Mon Sep 17 00:00:00 2001 From: Xavier Leroy Date: Fri, 5 Jul 2019 15:38:45 +0200 Subject: Rename option `-ffavor-branchless` into `-Obranchless` Easier to type, and consistent with `-Os` (optimize for smaller code / optimize for fewer conditional branches). --- driver/Clflags.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'driver/Clflags.ml') diff --git a/driver/Clflags.ml b/driver/Clflags.ml index d27871ef..2db9399f 100644 --- a/driver/Clflags.ml +++ b/driver/Clflags.ml @@ -28,7 +28,7 @@ let option_fconstprop = ref true let option_fcse = ref true let option_fredundancy = ref true let option_fifconversion = ref true -let option_ffavor_branchless = ref false +let option_Obranchless = ref false let option_falignfunctions = ref (None: int option) let option_falignbranchtargets = ref 0 let option_faligncondbranchs = ref 0 -- cgit From 4392758d3e9032edb1ea4a899b92fef886749fca Mon Sep 17 00:00:00 2001 From: David Monniaux Date: Mon, 9 Sep 2019 22:34:21 +0200 Subject: -fall-loads-nontrap --- driver/Clflags.ml | 1 + 1 file changed, 1 insertion(+) (limited to 'driver/Clflags.ml') diff --git a/driver/Clflags.ml b/driver/Clflags.ml index cf1220d1..fd8227c9 100644 --- a/driver/Clflags.ml +++ b/driver/Clflags.ml @@ -75,3 +75,4 @@ let option_fglobaladdroffset = ref false let option_fxsaddr = ref true let option_faddx = ref false let option_fcoalesce_mem = ref true +let option_all_loads_nontrap = ref false -- cgit From 2347476653201f154ffaea84f520e41cc0f32090 Mon Sep 17 00:00:00 2001 From: David Monniaux Date: Wed, 8 Jan 2020 12:46:10 +0100 Subject: connect forward-moves to compiler --- driver/Clflags.ml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'driver/Clflags.ml') diff --git a/driver/Clflags.ml b/driver/Clflags.ml index fd8227c9..9aa4a2bf 100644 --- a/driver/Clflags.ml +++ b/driver/Clflags.ml @@ -74,5 +74,6 @@ let option_fglobaladdrtmp = ref false let option_fglobaladdroffset = ref false let option_fxsaddr = ref true let option_faddx = ref false -let option_fcoalesce_mem = ref true +let option_fcoalesce_mem = ref true +let option_fforward_moves = ref true let option_all_loads_nontrap = ref false -- cgit From 893827f54addca2facc19a8f342b380d63114130 Mon Sep 17 00:00:00 2001 From: Cyril SIX Date: Mon, 27 Jan 2020 11:43:00 +0100 Subject: Added a flag to desactivate tail duplication --- driver/Clflags.ml | 1 + 1 file changed, 1 insertion(+) (limited to 'driver/Clflags.ml') diff --git a/driver/Clflags.ml b/driver/Clflags.ml index 9aa4a2bf..67ec9702 100644 --- a/driver/Clflags.ml +++ b/driver/Clflags.ml @@ -24,6 +24,7 @@ let option_fpacked_structs = ref false let option_ffpu = ref true let option_ffloatconstprop = ref 2 let option_ftailcalls = ref true +let option_fduplicate = ref true let option_fconstprop = ref true let option_fcse = ref true let option_fredundancy = ref true -- cgit From b54d18e2e26b3f7745870894d8087162eb33c545 Mon Sep 17 00:00:00 2001 From: Cyril SIX Date: Mon, 27 Jan 2020 13:25:56 +0100 Subject: Tail duplication optimization defaulting to off --- driver/Clflags.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'driver/Clflags.ml') diff --git a/driver/Clflags.ml b/driver/Clflags.ml index 67ec9702..088845fe 100644 --- a/driver/Clflags.ml +++ b/driver/Clflags.ml @@ -24,10 +24,10 @@ let option_fpacked_structs = ref false let option_ffpu = ref true let option_ffloatconstprop = ref 2 let option_ftailcalls = ref true -let option_fduplicate = ref true let option_fconstprop = ref true let option_fcse = ref true let option_fredundancy = ref true +let option_fduplicate = ref false let option_fpostpass = ref true let option_fpostpass_sched = ref "list" let option_fifconversion = ref true -- cgit From 5412aea57eafe2868244a514471d480b83fc51bd Mon Sep 17 00:00:00 2001 From: David Monniaux Date: Tue, 28 Jan 2020 13:59:55 +0100 Subject: connected (just a silly problem) --- driver/Clflags.ml | 1 + 1 file changed, 1 insertion(+) (limited to 'driver/Clflags.ml') diff --git a/driver/Clflags.ml b/driver/Clflags.ml index 2db9399f..b4ab51e7 100644 --- a/driver/Clflags.ml +++ b/driver/Clflags.ml @@ -26,6 +26,7 @@ let option_ffloatconstprop = ref 2 let option_ftailcalls = ref true let option_fconstprop = ref true let option_fcse = ref true +let option_fcse2 = ref true let option_fredundancy = ref true let option_fifconversion = ref true let option_Obranchless = ref false -- cgit From 7dca7590aa212806ee939244b253a6a067f34bfc Mon Sep 17 00:00:00 2001 From: Cyril SIX Date: Mon, 3 Feb 2020 10:52:53 +0100 Subject: Added flag to desactivate condition inversion --- driver/Clflags.ml | 1 + 1 file changed, 1 insertion(+) (limited to 'driver/Clflags.ml') diff --git a/driver/Clflags.ml b/driver/Clflags.ml index 088845fe..a195e38b 100644 --- a/driver/Clflags.ml +++ b/driver/Clflags.ml @@ -28,6 +28,7 @@ let option_fconstprop = ref true let option_fcse = ref true let option_fredundancy = ref true let option_fduplicate = ref false +let option_finvertcond = ref true (* only active if option_fduplicate is also true *) let option_fpostpass = ref true let option_fpostpass_sched = ref "list" let option_fifconversion = ref true -- cgit From 117a26880e27ae7d8efcb26d194c5ded3be642d6 Mon Sep 17 00:00:00 2001 From: Cyril SIX Date: Wed, 12 Feb 2020 16:47:03 +0100 Subject: Added option -ftracelinearize which linearizes based on ifnot branches --- driver/Clflags.ml | 1 + 1 file changed, 1 insertion(+) (limited to 'driver/Clflags.ml') diff --git a/driver/Clflags.ml b/driver/Clflags.ml index a195e38b..a4ebee9c 100644 --- a/driver/Clflags.ml +++ b/driver/Clflags.ml @@ -29,6 +29,7 @@ let option_fcse = ref true let option_fredundancy = ref true let option_fduplicate = ref false let option_finvertcond = ref true (* only active if option_fduplicate is also true *) +let option_ftracelinearize = ref false let option_fpostpass = ref true let option_fpostpass_sched = ref "list" let option_fifconversion = ref true -- cgit From b016de5a1a8230b5a6c51d8e7cd8829d39a4c781 Mon Sep 17 00:00:00 2001 From: Cyril SIX Date: Mon, 9 Mar 2020 15:16:08 +0100 Subject: [BROKEN] Replacing the boolean -fduplicate option by an integer To control the threshold for duplication --- driver/Clflags.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'driver/Clflags.ml') diff --git a/driver/Clflags.ml b/driver/Clflags.ml index 6d6f1df4..79c0bce0 100644 --- a/driver/Clflags.ml +++ b/driver/Clflags.ml @@ -28,8 +28,8 @@ let option_fconstprop = ref true let option_fcse = ref true let option_fcse2 = ref true let option_fredundancy = ref true -let option_fduplicate = ref false -let option_finvertcond = ref true (* only active if option_fduplicate is also true *) +let option_fduplicate = ref 0 +let option_finvertcond = ref true let option_ftracelinearize = ref false let option_fpostpass = ref true let option_fpostpass_sched = ref "list" -- cgit From 192d5f379b3f1efa6f12b45af36f7cfea21d6d50 Mon Sep 17 00:00:00 2001 From: David Monniaux Date: Sun, 15 Mar 2020 00:00:33 +0100 Subject: more inlining --- driver/Clflags.ml | 1 + 1 file changed, 1 insertion(+) (limited to 'driver/Clflags.ml') diff --git a/driver/Clflags.ml b/driver/Clflags.ml index 79c0bce0..ee5e9eeb 100644 --- a/driver/Clflags.ml +++ b/driver/Clflags.ml @@ -81,3 +81,4 @@ let option_faddx = ref false let option_fcoalesce_mem = ref true let option_fforward_moves = ref true let option_all_loads_nontrap = ref false +let option_inline_auto_threshold = ref 30 -- cgit From d0326db1105704e02e2b40facc2a85a267a2b9b5 Mon Sep 17 00:00:00 2001 From: David Monniaux Date: Sun, 15 Mar 2020 09:18:02 +0100 Subject: by default do not inline much --- driver/Clflags.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'driver/Clflags.ml') diff --git a/driver/Clflags.ml b/driver/Clflags.ml index ee5e9eeb..8054eb5b 100644 --- a/driver/Clflags.ml +++ b/driver/Clflags.ml @@ -81,4 +81,4 @@ let option_faddx = ref false let option_fcoalesce_mem = ref true let option_fforward_moves = ref true let option_all_loads_nontrap = ref false -let option_inline_auto_threshold = ref 30 +let option_inline_auto_threshold = ref 0 -- cgit From fb43d1078c0b0824132b30d7dd9bfe6b0ac47122 Mon Sep 17 00:00:00 2001 From: Cyril SIX Date: Tue, 17 Mar 2020 15:12:06 +0100 Subject: Desactivating branch predictions by default --- driver/Clflags.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'driver/Clflags.ml') diff --git a/driver/Clflags.ml b/driver/Clflags.ml index 8054eb5b..6986fb96 100644 --- a/driver/Clflags.ml +++ b/driver/Clflags.ml @@ -28,7 +28,7 @@ let option_fconstprop = ref true let option_fcse = ref true let option_fcse2 = ref true let option_fredundancy = ref true -let option_fduplicate = ref 0 +let option_fduplicate = ref (-1) let option_finvertcond = ref true let option_ftracelinearize = ref false let option_fpostpass = ref true -- cgit