public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <jeffreyalaw@gmail.com>
To: "Li, Pan2" <pan2.li@intel.com>,
	"gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Cc: "juzhe.zhong@rivai.ai" <juzhe.zhong@rivai.ai>,
	"Wang, Yanzhang" <yanzhang.wang@intel.com>,
	"kito.cheng@gmail.com" <kito.cheng@gmail.com>
Subject: Re: [PATCH v1] Mode-Switching: Add optional EMIT_AFTER hook
Date: Fri, 29 Sep 2023 14:29:17 -0600	[thread overview]
Message-ID: <bda89b2e-244c-4a5e-a02b-9bebd306900d@gmail.com> (raw)
In-Reply-To: <MW5PR11MB59085C1DAE22C66BF58562C3A9E3A@MW5PR11MB5908.namprd11.prod.outlook.com>



On 8/25/23 06:44, Li, Pan2 wrote:
> Hi Jeff,
> 
>> You might also peek at the RTL gcse/pre code which is also LCM based and
>> has the same class of problems.
> 
> I found a similar approach to take care of this in gcse.cc/pre_edge_insert with some comments as below.
> 
>    /* We can't insert anything on an abnormal and
>         critical edge, so we insert the insn at the end of
>         the previous block. There are several alternatives
>         detailed in Morgans book P277 (sec 10.5) for
>         handling this situation.  This one is easiest for
>         now.  */
> 
> if (eg->flags & EDGE_ABNORMAL)
>    insert_insn_end_basic_block (index_map[j], bb);
> else
>    {
>        insn = process_insert_insn (index_map[j]);
>        insert_insn_on_edge (insn, eg);
>    }
> 
> It looks the insert_insn_end_basic_block is designed to handle the ABNORMAL edge by inserting at end of previous block from the comments.
That's probably dead code at this point.  IIRC rth did further work in 
this space because inserting in the end of the block with the abnormal 
edge isn't semantically correct.

It's been 20+ years, but IIRC he adjusted the PRE bitmaps so that we 
never would need to do an insertion on an abnormal edge.  Search for 
EDGE_ABNORMAL in gcse.cc.

Jeff

  parent reply	other threads:[~2023-09-29 20:29 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-21  7:26 pan2.li
2023-08-21 14:24 ` Jeff Law
2023-08-23  6:03   ` Li, Pan2
2023-08-23 14:25     ` Jeff Law
2023-08-23 14:54       ` Li, Pan2
2023-08-23 23:26         ` Jeff Law
2023-08-24  4:53           ` Li, Pan2
2023-08-25 12:44             ` Li, Pan2
2023-09-11  8:36               ` Li, Pan2
2023-09-28  1:07                 ` Li, Pan2
2023-09-29 20:29               ` Jeff Law [this message]
2023-09-29 20:49             ` Jeff Law
2023-10-02  8:26               ` Robin Dapp
2023-10-05 11:51                 ` Li, Pan2
2023-08-26 13:36 ` [PATCH v2] " pan2.li

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=bda89b2e-244c-4a5e-a02b-9bebd306900d@gmail.com \
    --to=jeffreyalaw@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=juzhe.zhong@rivai.ai \
    --cc=kito.cheng@gmail.com \
    --cc=pan2.li@intel.com \
    --cc=yanzhang.wang@intel.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).