From 273f4053c61e258a365b82e6d2bc19b5cc2d5c0b Mon Sep 17 00:00:00 2001 From: zhenyu--zhao Date: Thu, 13 Feb 2025 11:02:07 +0800 Subject: [PATCH] Enhancing BOLT Optimization with AI. --- gcc/opts.cc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/gcc/opts.cc b/gcc/opts.cc index 2433ace06d2..0db866bdb35 100644 --- a/gcc/opts.cc +++ b/gcc/opts.cc @@ -3450,12 +3450,19 @@ common_handle_option (struct gcc_options *opts, break; case OPT_fauto_bolt_: - opts->x_flag_auto_bolt = true; + if (get_optimize_decision_from_ai4c ()) + { + opts->x_flag_auto_bolt = true; + } /* FALLTHRU */ case OPT_fauto_bolt: if (opts->x_flag_bolt_use) error_at (loc, "-fauto-bolt conflicts with -fbolt-use."); + if (get_optimize_decision_from_ai4c ()) + { + opts->x_flag_auto_bolt = true; + } break; case OPT_fbolt_use_: @@ -3463,6 +3470,10 @@ common_handle_option (struct gcc_options *opts, if (opts->x_flag_auto_bolt) error_at (loc, "-fauto-bolt conflicts with -fbolt-use."); + if (get_optimize_decision_from_ai4c ()) + { + opts->x_flag_bolt_use = true; + } break; case OPT_fbolt_target_: -- Gitee