public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "juzhe.zhong at rivai dot ai" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c/111848] New: RISC-V: RVV cost model pick unexpected big LMUL Date: Tue, 17 Oct 2023 11:03:14 +0000 [thread overview] Message-ID: <bug-111848-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111848 Bug ID: 111848 Summary: RISC-V: RVV cost model pick unexpected big LMUL Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: juzhe.zhong at rivai dot ai Target Milestone: --- #include <stdint.h> void f3 (uint8_t *restrict a, uint8_t *restrict b, uint8_t *restrict c, uint8_t *restrict d, int n) { for (int i = 0; i < n; ++i) { a[i * 8] = c[i * 8] + d[i * 8]; a[i * 8 + 1] = c[i * 8] + d[i * 8 + 1]; a[i * 8 + 2] = c[i * 8 + 2] + d[i * 8 + 2]; a[i * 8 + 3] = c[i * 8 + 2] + d[i * 8 + 3]; a[i * 8 + 4] = c[i * 8 + 4] + d[i * 8 + 4]; a[i * 8 + 5] = c[i * 8 + 4] + d[i * 8 + 5]; a[i * 8 + 6] = c[i * 8 + 6] + d[i * 8 + 6]; a[i * 8 + 7] = c[i * 8 + 6] + d[i * 8 + 7]; b[i * 8] = c[i * 8 + 1] + d[i * 8]; b[i * 8 + 1] = c[i * 8 + 1] + d[i * 8 + 1]; b[i * 8 + 2] = c[i * 8 + 3] + d[i * 8 + 2]; b[i * 8 + 3] = c[i * 8 + 3] + d[i * 8 + 3]; b[i * 8 + 4] = c[i * 8 + 5] + d[i * 8 + 4]; b[i * 8 + 5] = c[i * 8 + 5] + d[i * 8 + 5]; b[i * 8 + 6] = c[i * 8 + 7] + d[i * 8 + 6]; b[i * 8 + 7] = c[i * 8 + 7] + d[i * 8 + 7]; } } This case pick LMUL = 8 which causes horrible vector register spillings. After experiment, the ideal LMUL should be 2.
next reply other threads:[~2023-10-17 11:03 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-10-17 11:03 juzhe.zhong at rivai dot ai [this message] 2023-10-17 11:07 ` [Bug c/111848] " juzhe.zhong at rivai dot ai 2023-10-20 3:57 ` [Bug target/111848] " cvs-commit at gcc dot gnu.org 2023-10-20 6:39 ` juzhe.zhong at rivai dot ai
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-111848-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).