pro64-support
[Top] [All Lists]

Re: multi-entry CFG

To: Peng Zhao <pengzhao@xxxxxxxxxxxxxx>
Subject: Re: multi-entry CFG
From: David Stephenson <dlstephe@xxxxxxx>
Date: Mon, 27 Aug 2001 13:05:39 -0700
Cc: sgi <pro64-support@xxxxxxxxxxx>
Organization: SGI -- Compilers
References: <Pine.LNX.4.21.0108262200410.28336-100000@peers.cs.ualberta.ca>
Sender: owner-pro64-support@xxxxxxxxxxx
Peng Zhao wrote:

> 1. Is there any flag that mark the essential difference of the
> "real" entry and the "fake" & "dangling" entry? I noticed the real entry
> and exit are represented by green blocks. It seems that it is green
> because it is not in_out_same.

Fake entries and exits can be detected via code such as:

        if (bb == cfg->Fake_entry_bb() || bb == cfg->Fake_exit_bb())

To check whether a particular block is a "real" entry, use:

        if (bb->Kind() == BB_ENTRY && bb != Cfg()->Fake_entry_bb())

Dangling blocks will have bb->Kind() != BB_ENTRY.

Here is some code from opt_alias_analysis.cxx that searches for all
true entry blocks:

        if (Cfg()->Fake_entry_bb() != NULL) {
          BB_NODE *bb; 
          BB_LIST_ITER bb_iter;
          FOR_ALL_ELEM (bb, bb_iter, Init(Cfg()->Fake_entry_bb()->Succ())) {
            if (bb->Kind() == BB_ENTRY) {
              ...
            }
          }
        } else {
          BB_NODE *bb = Cfg()->Entry_bb();
          ...
        }

Also, take a look at the code in opt_cfg.cxx for the method
CFG::Process_multi_entryexit for the construction of the fake entry
and exit blocks.


> 2. Is there any special reason to left the "dangling" entry there?

They are generated by default, then eliminated by DCE.  This is
typical for WOPT; one phase uses another phase to perform some of
its work.

                                                        - David

-- 
David Stephenson        http://reality.sgi.com/dlstephe_engr/

<Prev in Thread] Current Thread [Next in Thread>