public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "vineetg at rivosinc dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/106533] New: loop distribution not distributing inner loop (to memcpy) when perfect loop nest Date: Fri, 05 Aug 2022 07:22:36 +0000 [thread overview] Message-ID: <bug-106533-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106533 Bug ID: 106533 Summary: loop distribution not distributing inner loop (to memcpy) when perfect loop nest Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: vineetg at rivosinc dot com Target Milestone: --- Created attachment 53415 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53415&action=edit test case When tinkering with a slightly modified version of stream benchmark [1] observed that Loop distribution is not distributing a nested copy loop into "0 loop and 1 libcall (memcpy)". This is with test built with -O2, mainline gcc, as of June 14, 2022: commit 6abe341558ab Actual test is attached but the loops look like following. Loop 7 (copy) is distributed to memcpy in general case - but not if benchmark built with #define COPYONLY (which elides loops 8,9,10 from compilation). -->8--- for (j=0; j<10000000; j++) { // 1 a[j] = 1.0; b[j] = 2.0; c[j] = 0.0; } for (j = 0; j < 10000000; j++) // 2 a[j] = 2.0E0 * a[j]; for (k=0; k<10; k++) // 3 { for (j=0; j<10000000; j++) c[j] = a[j]; // 7 #ifndef COPYONLY for (j=0; j<10000000; j++) b[j] = scalar*c[j]; // 8 for (j=0; j<10000000; j++) c[j] = a[j]+b[j]; // 9 for (j=0; j<10000000; j++) a[j] = b[j]+scalar*c[j]; // 10 #endif } for (k=1; k<10; k++) for (j=0; j<4; j++) // 6 avgtime[j] = avgtime[j] + times[j][k]; .. for (j=0; j<4; j++) // 5 avgtime[j] = avgtime[j]/(double)(NTIMES-1); .. -->8---
next reply other threads:[~2022-08-05 7:22 UTC|newest] Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-08-05 7:22 vineetg at rivosinc dot com [this message] 2022-08-05 7:32 ` [Bug tree-optimization/106533] " vineetg at rivosinc dot com 2022-08-05 7:35 ` vineetg at rivosinc dot com 2022-08-05 7:41 ` vineetg at rivosinc dot com 2022-08-05 8:36 ` rguenth at gcc dot gnu.org 2022-08-05 10:12 ` cvs-commit at gcc dot gnu.org 2022-08-05 10:12 ` rguenth at gcc dot gnu.org 2022-08-16 4:40 ` vineetg at rivosinc dot com 2022-08-16 7:16 ` rguenth at gcc dot gnu.org 2022-08-16 16:33 ` vineetg at rivosinc dot com 2022-08-16 16:48 ` pinskia at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-106533-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).