public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Andre Simoes Dias Vieira <avieira@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r13-6654] ifcvt: Lower bitfields only if suitable for scalar register [PR 109005]
Date: Tue, 14 Mar 2023 09:53:33 +0000 (GMT)	[thread overview]
Message-ID: <20230314095333.3A6FD3858D37@sourceware.org> (raw)

https://gcc.gnu.org/g:b109964ddb421cf481828a2f3465751a2bd6a8f6

commit r13-6654-gb109964ddb421cf481828a2f3465751a2bd6a8f6
Author: Andre Vieira <andre.simoesdiasvieira@arm.com>
Date:   Tue Mar 14 09:51:38 2023 +0000

    ifcvt: Lower bitfields only if suitable for scalar register [PR 109005]
    
    This patch fixes the condition check for eligilibity of lowering bitfields,
    where before we would check for non-BLKmode types, in the hope of excluding
    unsuitable aggregate types, we now check directly the representative is not an
    aggregate type, i.e. suitable for a scalar register.
    
    gcc/ChangeLog:
    
            PR tree-optimization/109005
            * tree-if-conv.cc (get_bitfield_rep): Replace BLKmode check with
            aggregate type check.

Diff:
---
 gcc/tree-if-conv.cc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gcc/tree-if-conv.cc b/gcc/tree-if-conv.cc
index f133102ad33..ca1abd8656c 100644
--- a/gcc/tree-if-conv.cc
+++ b/gcc/tree-if-conv.cc
@@ -3317,9 +3317,9 @@ get_bitfield_rep (gassign *stmt, bool write, tree *bitpos,
   tree field_decl = TREE_OPERAND (comp_ref, 1);
   tree rep_decl = DECL_BIT_FIELD_REPRESENTATIVE (field_decl);
 
-  /* Bail out if the representative is BLKmode as we will not be able to
-     vectorize this.  */
-  if (TYPE_MODE (TREE_TYPE (rep_decl)) == E_BLKmode)
+  /* Bail out if the representative is not a suitable type for a scalar
+     register variable.  */
+  if (!is_gimple_reg_type (TREE_TYPE (rep_decl)))
     return NULL_TREE;
 
   /* Bail out if the DECL_SIZE of the field_decl isn't the same as the BF's

                 reply	other threads:[~2023-03-14  9:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20230314095333.3A6FD3858D37@sourceware.org \
    --to=avieira@gcc.gnu.org \
    --cc=gcc-cvs@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: link
Be 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).