Use on-demand ranges in ssa_name_has_boolean_range before querying nonzero bits.
authorAldy Hernandez <aldyh@redhat.com>
Mon, 27 Sep 2021 07:20:56 +0000 (09:20 +0200)
committerAldy Hernandez <aldyh@redhat.com>
Mon, 27 Sep 2021 10:23:59 +0000 (12:23 +0200)
commitd5f8abe1d3f718a75cbff0a453c1d961be5939b7
tree2daf0cc101c3d63d7df5e86c3fc269f236442954
parente1d01f4973eee8d229ddc326ff7c3bd5f4cf32c1
Use on-demand ranges in ssa_name_has_boolean_range before querying nonzero bits.

The function ssa_name_has_boolean_range looks at the nonzero bits stored
in SSA_NAME_RANGE_INFO.  These are global in nature and are the result
of a previous evrp/VRP run (technically other passes can also set them).

However, we can do better if we use get_range_query.  Doing so will use
a ranger if enabled in a pass, or global ranges otherwise.  The call to
get_nonzero_bits remains, as there are passes that will set them
independently of the global range info.

Tested on x86-64 Linux with a regstrap as well as in a DOM environment
using an on-demand ranger instead of evrp.

gcc/ChangeLog:

* tree-ssanames.c (ssa_name_has_boolean_range): Use
get_range_query.
gcc/tree-ssanames.c