This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: A plan for eliminating cc0


kenner@vlsi1.ultra.nyu.edu (Richard Kenner) writes:

>     3) Write a new optimization pass enabled on targets which define
>        NOTICE_UPDATE_CC.  I think this pass would be run just before
>        machine dependent reorg, although perhaps there is a better place
>        for it.  Walk through the instructions, calling NOTICE_UPDATE_CC on
>        each one.  When we find an instruction which sets CC_REG, check the
>        source of the set with the current CC status, just as
>        final_scan_insn does now.  If the current CC status is the same,
>        delete the instruction which sets CC_REG.
> 
> My gut feeling is that we shouldn't need to do this: the present
> optimization passes should do this when we have an explicit register.

Well, in my proposal, I think they won't, because most of the
instructions which set CC_REG (e.g., arithmetic instructions) will be
marked as clobbering it.  So the optimizers won't be able to do
anything with that information.  The point of NOTICE_UPDATE_CC is that
it pulls out the information about how the condition code is set just
when we need it.

It is possible to mark each instruction with the affect it has on
CC_REG, by changing it into a parallel set.  Then the optimizers would
be able to see the change to CC_REG, and do the appropriate
combination.  However, this would be a lot more work, and moreover
it's not clear how effective it would be since so much of the compiler
calls single_set and is not prepared to handle instructions with
parallel sets.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]