public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug target/107093] New: AVX512 mask operations not simplified in fully masked loop Date: Fri, 30 Sep 2022 09:06:43 +0000 [thread overview] Message-ID: <bug-107093-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107093 Bug ID: 107093 Summary: AVX512 mask operations not simplified in fully masked loop Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: rguenth at gcc dot gnu.org Target Milestone: --- Trying to implement WHILE_ULT for AVX512 I run into optimization issues. Consider double a[1024], b[1024]; void foo (int n) { for (int i = 0; i < n; ++i) a[i] = b[i] * 3.; } compiled with -O3 -march=cascadelake --param vect-partial-vector-usage=2 I get snippets like kxnorb %k1, %k1, %k1 kortestb %k1, %k1 je .L11 or kxorb %k1, %k1, %k1 kxnorb %k1, %k1, %k1 where we fail to simplify the operations. Looking at the RTL it looks like missed jump threading, but I do see the ops being (insn 18 72 74 5 (parallel [ (set (reg:QI 69 k1 [orig:86 loop_mask_15 ] [86]) (not:QI (xor:QI (reg:QI 69 k1 [orig:86 loop_mask_15 ] [86]) (reg:QI 69 k1 [orig:86 loop_mask_15 ] [86])))) (unspec [ (const_int 0 [0]) ] UNSPEC_MASKOP) ]) 1912 {kxnorqi} (expr_list:REG_EQUAL (const_int -1 [0xffffffffffffffff]) (nil))) thus having an UNSPEC in them. When emitting a SET from constm1 I end up with mask<->GPR moves and if-converted code which isn't optimal either. When doing -fno-if-conversion I get .L7: vmovapd b(%rax), %ymm1{%k1} addl $4, %ecx movl %edi, %edx vmulpd %ymm2, %ymm1, %ymm0 subl %ecx, %edx vmovapd %ymm0, a(%rax){%k1} kxnorb %k1, %k1, %k1 cmpl $4, %edx jge .L5 vpbroadcastd %edx, %xmm0 vpcmpd $1, %xmm0, %xmm3, %k1 .L5: addq $32, %rax kortestb %k1, %k1 jne .L7 which also doesn't have the desired short-cut from the cmpl $4, %edx.
next reply other threads:[~2022-09-30 9:06 UTC|newest] Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-09-30 9:06 rguenth at gcc dot gnu.org [this message] 2022-09-30 9:09 ` [Bug target/107093] " rguenth at gcc dot gnu.org 2022-10-10 1:50 ` crazylht at gmail dot com 2022-10-11 9:23 ` cvs-commit at gcc dot gnu.org 2022-10-11 10:05 ` crazylht at gmail dot com 2022-10-11 10:13 ` crazylht at gmail dot com 2022-10-11 10:51 ` rguenth at gcc dot gnu.org 2022-10-11 10:59 ` rguenth at gcc dot gnu.org 2022-10-11 11:08 ` crazylht at gmail dot com 2022-10-11 11:14 ` rguenther at suse dot de 2023-07-24 8:21 ` rguenth 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-107093-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).