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 to
> internal 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.
> FOR_EACH_BB_FN (bb, fun)
> {
> @@ -1390,6 +1395,8 @@ pass_gimple_isel::execute (struct function *fun)
> }
> }
>
> + if (created_ranger)
> + disable_ranger (fun);
> return cfg_changed ? TODO_cleanup_cfg : 0;
> }
>
>
>
>
--
Richard Biener <[email protected]>
SUSE Software Solutions Germany GmbH,
Frankenstrasse 146, 90461 Nuernberg, Germany;
GF: Jochen Jaser, Andrew McDonald; (HRB 36809, AG Nuernberg)