From: Andrew MacLeod <amacleod@redhat.com>
To: Aldy Hernandez <aldyh@redhat.com>
Cc: GCC patches <gcc-patches@gcc.gnu.org>, Jeff Law <jeffreyalaw@gmail.com>
Subject: Re: [PATCH 2/7] Do not query SCEV in range_of_phi unless dominators are available.
Date: Tue, 21 Sep 2021 13:05:26 -0400 [thread overview]
Message-ID: <a248682b-e675-e97e-aa23-1b8e8e69adb6@redhat.com> (raw)
In-Reply-To: <20210921165350.414593-3-aldyh@redhat.com>
On 9/21/21 12:53 PM, Aldy Hernandez wrote:
> SCEV won't work without dominators and we can get called without
> dominators from debug_ranger.
>
> Another option would be to rename scev_initialized_p to something like
> scev_available_p and move the check there. For now, this will do.
>
> Committed.
>
> gcc/ChangeLog:
>
> * gimple-range-fold.cc (fold_using_range::range_of_phi): Check
> dom_info_available_p.
> ---
> gcc/gimple-range-fold.cc | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/gcc/gimple-range-fold.cc b/gcc/gimple-range-fold.cc
> index 997d02dd4b9..4dbf4188ec2 100644
> --- a/gcc/gimple-range-fold.cc
> +++ b/gcc/gimple-range-fold.cc
> @@ -781,7 +781,9 @@ fold_using_range::range_of_phi (irange &r, gphi *phi, fur_source &src)
> }
>
> // If SCEV is available, query if this PHI has any knonwn values.
> - if (scev_initialized_p () && !POINTER_TYPE_P (TREE_TYPE (phi_def)))
> + if (dom_info_available_p (CDI_DOMINATORS)
> + && scev_initialized_p ()
> + && !POINTER_TYPE_P (TREE_TYPE (phi_def)))
> {
> value_range loop_range;
> class loop *l = loop_containing_stmt (phi);
Im confused.. if scev doesn't work without dominators, how is
scev_initialized_p() true if there are no dominators? Are we
initializing it somewhere without dominators? Maybe there should be a
check in the scev init routine? seems like something else is amok.
void
scev_initialize (void)
{
gcc_assert (! scev_initialized_p ());
scalar_evolution_info = hash_table<scev_info_hasher>::create_ggc (100);
for (auto loop : loops_list (cfun, 0))
loop->nb_iterations = NULL_TREE;
}
/* Return true if SCEV is initialized. */
bool
scev_initialized_p (void)
{
return scalar_evolution_info != NULL;
}
next prev parent reply other threads:[~2021-09-21 17:05 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-21 16:53 [PATCH 0/7] Add ability to resolve unknowns to path solver Aldy Hernandez
2021-09-21 16:53 ` [PATCH 1/7] Allocate non_null_ref tables at creation Aldy Hernandez
2021-09-21 16:53 ` [PATCH 2/7] Do not query SCEV in range_of_phi unless dominators are available Aldy Hernandez
2021-09-21 17:05 ` Andrew MacLeod [this message]
2021-09-21 17:16 ` Aldy Hernandez
2021-09-22 8:05 ` Richard Biener
2021-09-23 11:07 ` Aldy Hernandez
2021-09-21 16:53 ` [PATCH 3/7] Move postfold_gcond_edges into fur_source Aldy Hernandez
2021-09-21 16:53 ` [PATCH 4/7] path solver: Add relation support Aldy Hernandez
2021-09-21 16:53 ` [PATCH 5/7] path solver: Remove useless code Aldy Hernandez
2021-09-21 16:53 ` [PATCH 6/7] path solver: Add related SSAs to solvable set Aldy Hernandez
2021-09-21 16:53 ` [PATCH 7/7] path solver: Use ranger to solve unknowns Aldy Hernandez
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=a248682b-e675-e97e-aa23-1b8e8e69adb6@redhat.com \
--to=amacleod@redhat.com \
--cc=aldyh@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jeffreyalaw@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).