From: Eric Botcazou <ebotcazou@adacore.com>
To: Richard Biener <richard.guenther@gmail.com>
Cc: gcc-patches@gcc.gnu.org, alan.lawrence@arm.com,
Martin Jambor <mjambor@suse.cz>
Subject: Re: [patch] Fix PR tree-optimization/70884
Date: Fri, 13 May 2016 11:01:00 -0000 [thread overview]
Message-ID: <20609673.FxQTIz62nb@polaris> (raw)
In-Reply-To: <CAFiYyc0bLjfH4c2r1xXJDqKQm43WA1kKeBQHUBdGgDA8qoREqQ@mail.gmail.com>
> Hmm, the patch looks obvious if it was the intent to allow constant
> pool replacements
> _not_ only when the whole constant pool entry may go away. But I
> think the intent was
> to not do this otherwise it will generate worse code by forcing all
> loads from the constant pool to appear at
> function start.
Do you mean when the whole constant pool entry is scalarized as opposed to
partially scalarized?
> So - the "real" issue may be a missing
> should_scalarize_away_bitmap/cannot_scalarize_away_bitmap
> check somewhere.
This seems to work:
Index: tree-sra.c
===================================================================
--- tree-sra.c (revision 236195)
+++ tree-sra.c (working copy)
@@ -2680,6 +2680,10 @@ analyze_all_variable_accesses (void)
EXECUTE_IF_SET_IN_BITMAP (tmp, 0, i, bi)
{
tree var = candidate (i);
+ if (constant_decl_p (var)
+ && (!bitmap_bit_p (should_scalarize_away_bitmap, i)
+ || bitmap_bit_p (cannot_scalarize_away_bitmap, i)))
+ continue;
struct access *access;
access = sort_and_splice_var_accesses (var);
but I have no idea whether this is correct or not.
Martin, are we sure to disable scalarization of constant_decl_p variables not
covered by initialize_constant_pool_replacements that way?
--
Eric Botcazou
next prev parent reply other threads:[~2016-05-13 11:01 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-07 21:22 Eric Botcazou
2016-05-09 10:02 ` Richard Biener
2016-05-13 11:01 ` Eric Botcazou [this message]
2016-05-13 11:52 ` Richard Biener
2016-05-13 15:24 ` Martin Jambor
2016-05-20 7:34 ` Eric Botcazou
2016-05-20 9:32 ` Richard Biener
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=20609673.FxQTIz62nb@polaris \
--to=ebotcazou@adacore.com \
--cc=alan.lawrence@arm.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=mjambor@suse.cz \
--cc=richard.guenther@gmail.com \
/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).