public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Insn removal.
@ 2000-05-28  8:46 Virgil Palanciuc
  2000-05-28  9:17 ` Virgil Palanciuc
  0 siblings, 1 reply; 2+ messages in thread
From: Virgil Palanciuc @ 2000-05-28  8:46 UTC (permalink / raw)
  To: Gcc@Gcc. Gnu. Org

  The context:

    I wrote a new instruction scheduler (starting from haifa-sched.c) that
works better for the VLIW architecture we work on. I mark the execution sets
using SImode for single-instruction execution sets, TImode for an
instruction which begins an execution set, HImode for an instruction that
ends an execution set, and TF,SF,TC,SC for execution sets that are executed
conditionally (I won't go into details here).

  My problem:
    Sometimes the jump-optimization step in jump.c (and probably some other
times the final step in final.c, too) is (correctly) removing unneeded
instructions. This is a problem for me, because they are removing
instructions that have markers on them (e.g. TImode, HImode etc.). I have
rewritten remove_insn() in emit-rtl.c but it seems nobody ever calls that
function (at least after the second scheduling step). AFAICT, the insns are
not actually removed, they are marked as removed instead using
INSN_DELETED_P(insn)=1. I should be able to solve this too in final.c, by
doing (in final()) something like:

    for(insn=start;insn;insn=NEXT_INSN(insn))
       while(insn && INSN_DELETED_P(insn)){
         rtx next=NEXT_INSN(insn);
         remove_insn(insn);
         insn=next;
       }

    I did that only to find out that remove_insn is STILL not called (I
placed an abort() at the beggining of remove_insn() ).

    This means that somewhere I am making a false assumption (like the one
that there is no other way to delete insns, maybe). What am I doing wrong?

       Virgil

P.S.
   I also tried to see if there are any code sequences that remove the
instructions 'by hand' - using something like NEXT_INSN (PREV_INSN (insn))=
NEXT_INSN (insn) etc.
   I didn't check very thoroughly, but AFAICT there is no such sequence
which might affect me.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE: Insn removal.
  2000-05-28  8:46 Insn removal Virgil Palanciuc
@ 2000-05-28  9:17 ` Virgil Palanciuc
  0 siblings, 0 replies; 2+ messages in thread
From: Virgil Palanciuc @ 2000-05-28  9:17 UTC (permalink / raw)
  To: Gcc@Gcc. Gnu. Org

> P.S.
>    I also tried to see if there are any code sequences that
> remove the instructions 'by hand' - using something like
> NEXT_INSN (PREV_INSN (insn))= NEXT_INSN (insn) etc.
>    I didn't check very thoroughly, but AFAICT there is no such
> sequence which might affect me.

     I solved my problem. I wasn't looking closely enough to delete_insn()
in jump.c. Initially, I thought it only sets the INSN_DELETED_P flag, and
that it is not actually removing the insn.
     Anyway, I think it would have be better to have all optimization steps
call remove_insn when removing an insn is required (though I feel that even
if you agree with me on this, nobody is willing/capable to make the
modifications everywhere).

     Sorry for disturbing you and thanks again for the great help you have
been so far.

   Virgil.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2000-05-28  9:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-05-28  8:46 Insn removal Virgil Palanciuc
2000-05-28  9:17 ` Virgil Palanciuc

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).