https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69728

--- Comment #22 from Sebastian Pop <spop at gcc dot gnu.org> ---
> I put it on my TODO to figure out how to "DCE" a stmt
> (or in this case it's rather the whole "loop body", right?).

The code generator would not even see a statement to be generated: it would
just disappear in the new code, so there is nothing to do to DCE statements
with empty domains.

> I've not fully found my way through initial schedule building yet
> (otherwise I would have tried refactoring to not operate in pbb
> vector order but more naturally follow the SESE in a CFG walk with
> maintaining a BB -> pbb mapping).

Yes, DOM-walk could be used to detect the sequential order in which basic
blocks are executed.

There are some difficulties in giving an execution sequence number for if-then
and if-else clauses, and for switch cases: for the moment we represent them as
executing in sequence.  For example,

if (c)
  a;
else
  b;

we would number the stmts a and b as if the code looked like this:

if (c)
  a;
if (!c)
  b;

which is correct.
The fact that the constraint "c" is added to the iteration domain of "a", and
"!c" added to the iter domain of "b" allows the scheduler to know that there
are no sequential dependences between stmts "a" and "b" as they are executed in
different iterations.

Reply via email to