diff options
author | Andrew MacLeod <amacleod@redhat.com> | 2024-06-17 11:38:46 -0400 |
---|---|---|
committer | Andrew MacLeod <amacleod@redhat.com> | 2024-06-25 15:50:49 -0400 |
commit | 1ea95cc5e099d554764b82df8e972129e9d20885 (patch) | |
tree | fe1804024ae491f9469936f367c5e964068a8938 /gcc/tree-vrp.cc | |
parent | ed6ffc4e62f716d1b31d599d22594dd969da137f (diff) | |
download | gcc-1ea95cc5e099d554764b82df8e972129e9d20885.zip gcc-1ea95cc5e099d554764b82df8e972129e9d20885.tar.gz gcc-1ea95cc5e099d554764b82df8e972129e9d20885.tar.bz2 |
Add param for bb limit to invoke fast_vrp.
If the basic block count is too high, simply use fast_vrp for all
VRP passes.
* doc/invoke.texi (vrp-block-limit): Document.
* params.opt (param=vrp-block-limit): New.
* tree-vrp.cc (fvrp_folder::execute): Invoke fast_vrp if block
count exceeds limit.
Diffstat (limited to 'gcc/tree-vrp.cc')
-rw-r--r-- | gcc/tree-vrp.cc | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/gcc/tree-vrp.cc b/gcc/tree-vrp.cc index 26979b7..e184e9a 100644 --- a/gcc/tree-vrp.cc +++ b/gcc/tree-vrp.cc @@ -60,6 +60,7 @@ along with GCC; see the file COPYING3. If not see #include "ipa-cp.h" #include "ipa-prop.h" #include "attribs.h" +#include "diagnostic-core.h" // This class is utilized by VRP and ranger to remove __builtin_unreachable // calls, and reflect any resulting global ranges. @@ -1331,9 +1332,18 @@ public: unsigned int execute (function *fun) final override { // Check for fast vrp. - if (&data == &pass_data_fast_vrp) + bool use_fvrp = (&data == &pass_data_fast_vrp); + if (!use_fvrp && last_basic_block_for_fn (fun) > param_vrp_block_limit) + { + use_fvrp = true; + warning (OPT_Wdisabled_optimization, + "Using fast VRP algorithm. %d basic blocks" + " exceeds %<--param=vrp-block-limit=%d%> limit", + n_basic_blocks_for_fn (fun), + param_vrp_block_limit); + } + if (use_fvrp) return execute_fast_vrp (fun, final_p); - return execute_ranger_vrp (fun, final_p); } |