public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 0/3] gimple-fold improvements
@ 2021-11-11 19:41 Siddhesh Poyarekar
  2021-11-11 19:41 ` [PATCH 1/3] gimple-fold: Transform stp*cpy_chk to str*cpy directly Siddhesh Poyarekar
                   ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Siddhesh Poyarekar @ 2021-11-11 19:41 UTC (permalink / raw)
  To: gcc-patches

This patchset improves folding in cases where input lengths
and/or destination sizes may not be constant but are range bound.

Tested on x86_64 with a full bootstrap build and verified that there are
no regressions resulting from this patchset.

Also tested a build of bash, which results in 3 __memcpy_chk calls being
optimized away completely in addition to a couple of memmove and strcpy
chk variants being transformed into regular calls.

Siddhesh Poyarekar (3):
  gimple-fold: Transform stp*cpy_chk to str*cpy directly
  gimple-fold: Use ranges to simplify _chk calls
  gimple-fold: Use ranges to simplify strncat and snprintf

 gcc/gimple-fold.c                       | 312 +++++++++---------------
 gcc/testsuite/gcc.dg/Wobjsize-1.c       |   5 +-
 gcc/testsuite/gcc.dg/fold-stringops-1.c |  23 ++
 gcc/testsuite/gcc.dg/fold-stringops-2.c |  63 +++++
 gcc/testsuite/gcc.dg/fold-stringops-3.c |  18 ++
 5 files changed, 220 insertions(+), 201 deletions(-)
 create mode 100644 gcc/testsuite/gcc.dg/fold-stringops-1.c
 create mode 100644 gcc/testsuite/gcc.dg/fold-stringops-2.c
 create mode 100644 gcc/testsuite/gcc.dg/fold-stringops-3.c

-- 
2.31.1


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2021-11-15 22:53 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-11 19:41 [PATCH 0/3] gimple-fold improvements Siddhesh Poyarekar
2021-11-11 19:41 ` [PATCH 1/3] gimple-fold: Transform stp*cpy_chk to str*cpy directly Siddhesh Poyarekar
2021-11-12 17:16   ` Prathamesh Kulkarni
2021-11-14  5:48     ` Siddhesh Poyarekar
2021-11-11 19:41 ` [PATCH 2/3] gimple-fold: Use ranges to simplify _chk calls Siddhesh Poyarekar
2021-11-11 19:41 ` [PATCH 3/3] gimple-fold: Use ranges to simplify strncat and snprintf Siddhesh Poyarekar
2021-11-15 10:41   ` Siddhesh Poyarekar
2021-11-15 17:33 ` [PATCH v2 0/3] gimple-fold improvements Siddhesh Poyarekar
2021-11-15 17:33   ` [PATCH v2 1/3] gimple-fold: Transform stp*cpy_chk to str*cpy directly Siddhesh Poyarekar
2021-11-15 19:17     ` Jeff Law
2021-11-15 17:33   ` [PATCH v2 2/3] gimple-fold: Use ranges to simplify _chk calls Siddhesh Poyarekar
2021-11-15 20:25     ` Jeff Law
2021-11-15 22:53       ` Siddhesh Poyarekar
2021-11-15 17:33   ` [PATCH v2 3/3] gimple-fold: Use ranges to simplify strncat and snprintf Siddhesh Poyarekar
2021-11-15 19:38     ` Jeff Law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).