diff options
| author | Andrew Pinski <andrew.pinski@oss.qualcomm.com> | 2025-10-26 12:21:08 -0700 |
|---|---|---|
| committer | Andrew Pinski <andrew.pinski@oss.qualcomm.com> | 2025-10-27 16:09:07 -0700 |
| commit | 89f8c4709446f4b16fe88ac25cfef7fa9a73f296 (patch) | |
| tree | e364243039da9ed8fb3e374d434e757f2502de75 /contrib/gcc-changelog/git_commit.py | |
| parent | 2f7edefc54e6967168c3cce3a4347cc0bc6a8155 (diff) | |
| download | gcc-89f8c4709446f4b16fe88ac25cfef7fa9a73f296.zip gcc-89f8c4709446f4b16fe88ac25cfef7fa9a73f296.tar.gz gcc-89f8c4709446f4b16fe88ac25cfef7fa9a73f296.tar.bz2 | |
expand: Move the [0,1] detection for a*b to use the ranger
In r14-6418-gacbfb8b9495b, the detection of boolean range was moved
over to use gimple_zero_one_valued_p but now that we can use the full ranger
during expand, let's use that instead. Adds a new helper function called
expr_has_boolean_range. This calls ssa_name_has_boolean_range when there
is an ssa name; otherwise checks the constant value for boolean[0,1].
An example is:
```
unsigned f(unsigned b, unsigned c, unsigned d)
{
if (b <= 1)
return b * c;
return d;
}
```
Where before this would not try to expand as `c & -b` but we know that b has [0,1] range,
this will expand as `c & -b` for many targets.
Bootstrapped and tested on x86_64-linux-gnu.
gcc/ChangeLog:
* expr.cc (expr_has_boolean_range): New function.
(expand_expr_real_2): Use expr_has_boolean_range instead of
gimple_zero_one_valued_p.
* tree-ssanames.cc (ssa_name_has_boolean_range): Update to take
a gimple STMT.
* tree-ssanames.h (ssa_name_has_boolean_range): Update for the new
argument and default to nullptr.
Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
Diffstat (limited to 'contrib/gcc-changelog/git_commit.py')
0 files changed, 0 insertions, 0 deletions
