This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Fix flag_fp_contract_mode with LTO
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 29 Jan 2015 06:07:55 +0100
- Subject: Fix flag_fp_contract_mode with LTO
- Authentication-results: sourceware.org; auth=none
Hi,
Igor found an performance regression related to my patch enabling option
streaming. It turns out that with LTO we disable FMA instruction generation
because fp_contract_mode is not streamed and set to 0.
This is because patch https://gcc.gnu.org/ml/gcc-patches/2010-11/msg01827.html
that makes fp_contract_mode special hanled by the generator but i fialed to
copy this to option streaming.
The support for general enums was added later and there is no longer reason
to special case this.
Bootstrapped/regtested x86_64-linux, comitted.
* optc-save-gen.awk: flag_fp_contract_mode is no longer speical.
* opth-gen.awk: Likewise.
* common.opt: Mark flag_fp_contract_mode as Optimization.
Index: optc-save-gen.awk
===================================================================
--- optc-save-gen.awk (revision 220228)
+++ optc-save-gen.awk (working copy)
@@ -87,7 +87,7 @@ print "{";
n_opt_char = 3;
n_opt_short = 0;
n_opt_int = 0;
-n_opt_enum = 1;
+n_opt_enum = 0;
n_opt_other = 0;
var_opt_char[0] = "optimize";
var_opt_char[1] = "optimize_size";
@@ -95,7 +95,6 @@ var_opt_char[2] = "optimize_debug";
var_opt_range["optimize"] = "0, 255";
var_opt_range["optimize_size"] = "0, 1";
var_opt_range["optimize_debug"] = "0, 1";
-var_opt_enum[0] = "flag_fp_contract_mode";
# Sort by size to mimic how the structure is laid out to be friendlier to the
# cache.
Index: opth-gen.awk
===================================================================
--- opth-gen.awk (revision 220228)
+++ opth-gen.awk (working copy)
@@ -135,12 +135,11 @@ print "{";
n_opt_char = 3;
n_opt_short = 0;
n_opt_int = 0;
-n_opt_enum = 1;
+n_opt_enum = 0;
n_opt_other = 0;
var_opt_char[0] = "unsigned char x_optimize";
var_opt_char[1] = "unsigned char x_optimize_size";
var_opt_char[2] = "unsigned char x_optimize_debug";
-var_opt_enum[0] = "enum fp_contract_mode x_flag_fp_contract_mode";
for (i = 0; i < n_opts; i++) {
if (flag_set_p("Optimization", flags[i])) {
Index: common.opt
===================================================================
--- common.opt (revision 220228)
+++ common.opt (working copy)
@@ -1248,7 +1248,7 @@ Common Report Var(flag_forward_propagate
Perform a forward propagation pass on RTL
ffp-contract=
-Common Joined RejectNegative Enum(fp_contract_mode) Var(flag_fp_contract_mode) Init(FP_CONTRACT_FAST)
+Common Joined RejectNegative Enum(fp_contract_mode) Var(flag_fp_contract_mode) Init(FP_CONTRACT_FAST) Optimization
-ffp-contract=[off|on|fast] Perform floating-point expression contraction.
Enum