On 7/7/26 07:32, Richard Biener wrote:
On Tue, 7 Jul 2026, Tamar Christina wrote:This enabled ranger for use in isel to do some ranged based foldings. Not much else to write about this one :) Bootstrapped Regtested on aarch64-none-linux-gnu, arm-none-linux-gnueabihf, x86_64-pc-linux-gnu -m32, -m64 and no issues. Ok for master? Thanks, Tamar gcc/ChangeLog: * gimple-isel.cc (pass_gimple_isel::execute): Enable and disable ranger on fun. --- diff --git a/gcc/gimple-isel.cc b/gcc/gimple-isel.cc index b193e27b183e1a83d73369b629c81ea0d7db43cd..0bd3a2f732922bc939c9d5fb4a221764def6e756 100644 --- a/gcc/gimple-isel.cc +++ b/gcc/gimple-isel.cc @@ -40,6 +40,8 @@ along with GCC; see the file COPYING3. If not see #include "gimple-fold.h" #include "internal-fn.h" #include "fold-const.h" +#include "gimple-range.h" +/* Expand all ARRAY_REF(VIEW_CONVERT_EXPR) gimple assignments into calls tointernal function based on vector type of selected expansion. @@ -1352,6 +1354,9 @@ pass_gimple_isel::execute (struct function *fun) gimple_stmt_iterator gsi; basic_block bb; bool cfg_changed = false; + bool created_ranger = get_range_query (fun) == get_global_range_query (); + if (created_ranger) + enable_ranger (fun);We shouldn't have an active ranger across passes, do we? I do not see us folding stmts here, not .WHILE_ULT anyway, so I'm missing the point of this (in isolation). That said, just enable_ranger()/disable_ranger() w/o checks is OK with me, hopefully all the cost is on-demand.
No active rangers across passes. Any cross-pass info is through SSA_NAME_RANGE_INFO. And yes, enable_ranger has very little cost until its actually used, and then it is on demand as needed.
Andrew
