public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Erick Ochoa <erick.ochoa@theobroma-systems.com>
To: Gary Oblock <gary@amperecomputing.com>,
	"gcc@gcc.gnu.org" <gcc@gcc.gnu.org>
Subject: Re: Dominance information problem
Date: Mon, 14 Sep 2020 09:10:39 +0200	[thread overview]
Message-ID: <68b21e05-2939-599c-a2eb-edfd1bccf905@theobroma-systems.com> (raw)
In-Reply-To: <BYAPR01MB5464FA27CCD648A5D065BE7BC6250@BYAPR01MB5464.prod.exchangelabs.com>

Hi Gary,

I'm not 100% sure this will fix the problem, but in the past I have had 
to call the following function:

   /* If dominator info is not available, we need to calculate it.  */
   if (!dom_info_available_p (CDI_DOMINATORS))
     calculate_dominance_info (CDI_DOMINATORS);

Basically dominance information was not available for cfun.
Also, you might also need to call:

   if (dom_info_available_p (CDI_DOMINATORS))
     free_dominance_info (CDI_DOMINATORS);

Just before your pass is done. These were some calls I needed to make in 
a different pass when I was working with dominators.

On 12/09/2020 09:26, Gary Oblock wrote:
> I'm trying to do performance qualification for my structure
> reorganization optimization.
> 
> I'm doing pretty straightforward stuff and I haven't at this point in
> time (qualifying the optimization,) modified the program. So I'm a
> little surprised this is failing.  Here is the code that's failing on
> the first iteration of the for loops:
> 
>    struct cgraph_node *node;
>    FOR_EACH_FUNCTION_WITH_GIMPLE_BODY ( node)  {
>      struct function *func = DECL_STRUCT_FUNCTION ( node->decl);
>      push_cfun ( func);
> 
>      class loop *loop;
>      FOR_EACH_LOOP_FN ( func, loop, LI_ONLY_INNERMOST )
>        {
>          size_t num_bbs = loop->num_nodes;
>          basic_block *bbs = get_loop_body ( loop); // FAILS HERE!!!
>          :
>          stuff never reached
> 
> How it's failing (in code from dominance.c) I'm guessing tells me the
> dominance information is messed up (unlikely) or needs to be
> recomputed. If I'm not wrong, how do I go about doing the later????
> 
> /* Return TRUE in case BB1 is dominated by BB2.  */
> bool
> dominated_by_p (enum cdi_direction dir, const_basic_block bb1, const_basic_block bb2)
> {
>    unsigned int dir_index = dom_convert_dir_to_idx (dir);
>    struct et_node *n1 = bb1->dom[dir_index], *n2 = bb2->dom[dir_index];
> 
>    gcc_checking_assert (dom_computed[dir_index]); // <=========== BOOM!
> 
>    if (dom_computed[dir_index] == DOM_OK)
>      return (n1->dfs_num_in >= n2->dfs_num_in
>       && n1->dfs_num_out <= n2->dfs_num_out);
> 
>    return et_below (n1, n2);
> }
> 
> 
> Thanks,
> 
> Gary Oblock
> 
> 
> 
> 
> 
> 
> CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and contains information that is confidential and proprietary to Ampere Computing or its subsidiaries. It is to be used solely for the purpose of furthering the parties' business relationship. Any unauthorized review, copying, or distribution of this email (or any attachments thereto) is strictly prohibited. If you are not the intended recipient, please contact the sender immediately and permanently delete the original and any copies of this email and any attachments thereto.
> 

  reply	other threads:[~2020-09-14  7:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-12  7:26 Gary Oblock
2020-09-14  7:10 ` Erick Ochoa [this message]
2020-09-14 18:20   ` Gary Oblock

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=68b21e05-2939-599c-a2eb-edfd1bccf905@theobroma-systems.com \
    --to=erick.ochoa@theobroma-systems.com \
    --cc=gary@amperecomputing.com \
    --cc=gcc@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).