public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/106378] New: Miss to handle ifn .LEN_STORE in DSE
@ 2022-07-21  7:54 linkw at gcc dot gnu.org
  2022-07-21  8:18 ` [Bug tree-optimization/106378] " rguenth at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: linkw at gcc dot gnu.org @ 2022-07-21  7:54 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 106378
           Summary: Miss to handle ifn .LEN_STORE in DSE
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: linkw at gcc dot gnu.org
                CC: rguenth at gcc dot gnu.org, rsandifo at gcc dot gnu.org,
                    segher at gcc dot gnu.org
        Depends on: 106365
  Target Milestone: ---
            Target: powerpc*-linux-gnu

+++ This bug was initially created as a clone of Bug #106365 +++

In PR106365, Richi has fixed the miss optimization on {MASK/LEN}_STORE by
teaching VN about these IFNs. But it further exposes one miss optimization in
DSE for LEN_STORE.

With the option -O3 -mcpu=power10 -fno-vect-cost-model, check the optimized
dumpings.

--------------

for the case gcc/testsuite/gcc.dg/tree-ssa/pr84512.c, we expect to get:

int foo ()
{
  <bb 2> [local count: 97603129]:
  return 285;
}

but it gets now:

int foo ()
{
  int a[10];

  <bb 2> [local count: 97603129]:
  .LEN_STORE (&MEM <int[10]> [(void *)&a + 32B], 128B, 8, { 64, 0, 0, 0, 81, 0,
0, 0, 100, 0, 0, 0, 121, 0, 0, 0 }, 0);
  a ={v} {CLOBBER(eol)};
  return 285;

}

--------------

for the case Richi posted:

int __attribute__((noinline,noclone))
foo ()
{
  int out[10];
  int i;
  for (i = 0; i < 10; ++i)
    {
      out[i] = i;
    }
  return out[9];
}

it gets:

__attribute__((noclone, noinline))
int foo ()
{
  int out[10];

  <bb 2> [local count: 97603129]:
  .LEN_STORE (&MEM <int[10]> [(void *)&out + 32B], 128B, 8, { 8, 0, 0, 0, 9, 0,
0, 0, 10, 0, 0, 0, 11, 0, 0, 0 }, 0);
  out ={v} {CLOBBER(eol)};
  return 9;

}


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106365
[Bug 106365] Miss to handle ifn .LEN_STORE in FRE

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

end of thread, other threads:[~2022-07-21 11:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-21  7:54 [Bug tree-optimization/106378] New: Miss to handle ifn .LEN_STORE in DSE linkw at gcc dot gnu.org
2022-07-21  8:18 ` [Bug tree-optimization/106378] " rguenth at gcc dot gnu.org
2022-07-21  8:18 ` rguenth at gcc dot gnu.org
2022-07-21  8:28 ` linkw at gcc dot gnu.org
2022-07-21 11:06 ` cvs-commit at gcc dot gnu.org
2022-07-21 11:24 ` rguenth at gcc dot gnu.org
2022-07-21 11:24 ` rguenth 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).