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 tree-optimization/101801] New: vect_worthwhile_without_simd_p is broken Date: Fri, 06 Aug 2021 10:26:09 +0000 [thread overview] Message-ID: <bug-101801-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101801 Bug ID: 101801 Summary: vect_worthwhile_without_simd_p is broken Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: rguenth at gcc dot gnu.org Target Milestone: --- vect_worthwhile_without_simd_p is currently bool vect_worthwhile_without_simd_p (vec_info *vinfo, tree_code code) { loop_vec_info loop_vinfo = dyn_cast <loop_vec_info> (vinfo); unsigned HOST_WIDE_INT value; return (loop_vinfo && LOOP_VINFO_VECT_FACTOR (loop_vinfo).is_constant (&value) && value >= vect_min_worthwhile_factor (code)); } which means it's never worthwhile to BB vectorize. Also the VF check doesn't honor SLP so that a fully SLPed loop with VF == 1 is never considered worthwhile to vectorize. I ran into this beast when looking at vectorization of mask condition operations like cond_mask1 & cond_mask2 which, for AVX512, have integer mode but vectorizable_operation does /* Worthwhile without SIMD support? Check only during analysis. */ if (!VECTOR_MODE_P (vec_mode) && !vec_stmt && !vect_worthwhile_without_simd_p (vinfo, code)) { if (dump_enabled_p ()) dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, "not worthwhile without SIMD support.\n"); return false; } and in my case with SLP the VF was indeed one and vectorization failed. I think the code should not look at the vectorization factor but instead at the vector type (and its number of components).
next reply other threads:[~2021-08-06 10:26 UTC|newest] Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-08-06 10:26 rguenth at gcc dot gnu.org [this message] 2021-08-06 10:27 ` [Bug tree-optimization/101801] " rguenth at gcc dot gnu.org 2021-08-06 11:09 ` rsandifo at gcc dot gnu.org 2021-08-06 11:12 ` rsandifo at gcc dot gnu.org 2021-08-06 11:21 ` rguenth at gcc dot gnu.org 2021-08-06 13:32 ` cvs-commit at gcc dot gnu.org 2021-08-06 13:33 ` rguenth at gcc dot gnu.org 2021-08-10 8:12 ` cvs-commit at gcc dot gnu.org 2021-08-25 2:32 ` 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-101801-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).