public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/114822] New: ldist should produce memcpy/memset/memmove histograms based on loop information converted
@ 2024-04-23  9:44 hubicka at gcc dot gnu.org
  0 siblings, 0 replies; only message in thread
From: hubicka at gcc dot gnu.org @ 2024-04-23  9:44 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114822

            Bug ID: 114822
           Summary: ldist should produce memcpy/memset/memmove histograms
                    based on loop information converted
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hubicka at gcc dot gnu.org
  Target Milestone: ---

When loop is converted to string builtin we lose information about its size.
This means that we won't expand it inline when the block size is expected to be
small.  This causes performance problem i.e. on std::vector and testcase from
PR114821  which at least with profile feedback runs significantly slower than
variant where memcpy is produced early


#include <vector>
typedef unsigned int uint32_t;
int pair;
void
test()
{
        std::vector<int> stack;
        stack.push_back (pair);
        while (!stack.empty()) {
                int cur = stack.back();
                stack.pop_back();
                if (true)
                {
                        cur++;
                        stack.push_back (cur);
                        stack.push_back (cur);
                }
                if (cur > 10000)
                        break;
        }
}
int
main()
{
        for (int i = 0; i < 10000; i++)
          test();
}

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-04-23  9:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-23  9:44 [Bug middle-end/114822] New: ldist should produce memcpy/memset/memmove histograms based on loop information converted hubicka at gcc dot gnu.org

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).