diff options
author | Jovan Vukic <Jovan.Vukic@rt-rk.com> | 2024-12-14 14:47:35 -0700 |
---|---|---|
committer | Jeff Law <jlaw@ventanamicro.com> | 2024-12-14 14:48:23 -0700 |
commit | ad519f46194a7ab1671470a236c67ae17cb98ead (patch) | |
tree | c0b567b8b9e81224b795d437c7b2066053f9dfdd /gcc/fortran/trans-expr.cc | |
parent | 6866547e2421cc40606c13c2c3621a3d9121e893 (diff) | |
download | gcc-ad519f46194a7ab1671470a236c67ae17cb98ead.zip gcc-ad519f46194a7ab1671470a236c67ae17cb98ead.tar.gz gcc-ad519f46194a7ab1671470a236c67ae17cb98ead.tar.bz2 |
[PATCH v3] match.pd: Add pattern to simplify `(a - 1) & -a` to `0`
Thank you for the feedback. I have made the minor changes that were requested.
Additionally, I extracted the repetitive code into a reusable helper function,
match_plus_neg_pattern, making the code much more readable. Furthermore, the
logic, code, and tests remain the same as in version 2 of the patch.
gcc/ChangeLog:
* match.pd: New pattern.
* simplify-rtx.cc (match_plus_neg_pattern): New helper function.
(simplify_context::simplify_binary_operation_1): New
code to handle (a - 1) & -a, (a - 1) | -a and (a - 1) ^ -a.
gcc/testsuite/ChangeLog:
* gcc.dg/tree-ssa/bitops-11.c: New test.
Diffstat (limited to 'gcc/fortran/trans-expr.cc')
0 files changed, 0 insertions, 0 deletions