public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "enkovich.gnu at gmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/50037] New: Unroll factor exceeds max trip count Date: Wed, 10 Aug 2011 14:44:00 -0000 [thread overview] Message-ID: <bug-50037-4@http.gcc.gnu.org/bugzilla/> (raw) http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50037 Bug #: 50037 Summary: Unroll factor exceeds max trip count Classification: Unclassified Product: gcc Version: 4.7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: rtl-optimization AssignedTo: unassigned@gcc.gnu.org ReportedBy: enkovich.gnu@gmail.com Created attachment 24971 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24971 Reproducer Here is a small loop on which GCC performs inefficient unroll: for ( count = ((*(hdrptr)) & 0xf) * 2; count > 0; count--, addr++ ) sum += *addr; This loop has maximum 30 iterations. If we use -O3 then this loop is vectorized. Resulting loop has maximum 30 / 8 = 3 iteration. Also vectorizer generates prologue and epilogue loops. Each of them has maximum 7 iterations. If we add -funroll-loops option then each of 3 generated by vectorizer loops is unrolled with unroll factor 8. It creates a lot of code which is never executed and also decreases performance due to additional checks and branches. Target: x86_64-unknown-linux-gnu Configured with: ../gcc1/configure --prefix=/export/gcc-perf/install --enable-languages=c,c++,fortran Thread model: posix gcc version 4.7.0 20110615 (experimental) (GCC) COLLECT_GCC_OPTIONS='-O3' '-funroll-loops' '-S' '-v' '-mtune=generic' '-march=x86-64' /export/gcc-perf/install/libexec/gcc/x86_64-unknown-linux-gnu/4.7.0/cc1 -quiet -v unroll_test.c -quiet -dumpbase unroll_test.c -mtune=generic -march=x86-64 -auxbase unroll_test -O3 -version -funroll-loops -o unroll_test.s GNU C (GCC) version 4.7.0 20110615 (experimental) (x86_64-unknown-linux-gnu) compiled by GNU C version 4.4.3, GMP version 4.3.1, MPFR version 2.4.2, MPC version 0.8.1 GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
next reply other threads:[~2011-08-10 14:44 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2011-08-10 14:44 enkovich.gnu at gmail dot com [this message] 2011-08-10 15:14 ` [Bug rtl-optimization/50037] " rguenth at gcc dot gnu.org 2011-08-10 15:33 ` enkovich.gnu at gmail dot com 2011-08-10 15:42 ` rguenth at gcc dot gnu.org 2011-08-10 16:57 ` matz at gcc dot gnu.org 2011-08-11 11:23 ` rguenth at gcc dot gnu.org 2011-08-11 11:41 ` rguenth at gcc dot gnu.org 2011-08-11 12:14 ` rguenth at gcc dot gnu.org 2011-08-15 9:12 ` enkovich.gnu at gmail dot com 2021-12-18 23:15 ` 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-50037-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).