Zack Weinberg <[EMAIL PROTECTED]> writes:

> Ian Lance Taylor <ian@airs.com> writes:
> 
> > 3) Write a new CC0 collapse pass.  This pass is run immediately
> > after RTL expansion.  It walks the instruction stream looking for
> > instructions which set and use CC_REG.  At this point these
> > instructions will always be adjacent.  The pass combines them into
> > the combined instruction defined in step 2c above.
> 
> I'm not understanding why this is a separate pass, instead of
> generating the combined instructions directly in the expander.  I
> think generic expander support for compare-and-branch instructions
> already exists...

We have to worry not just about compare-and-branch, but also about
test-and-branch, compare-and-set, compare-and-move, and
compare-and-add.  Basically, look for the various calls to
emit_cmp_insn.  We could modify the expander to try combined
instructions in all those cases.  Or we could modify the cc0 backends
to save the comparison operands in cmpMODE and use them in the various
conditional instructions (that was my original proposal).  Overall it
seems simpler to use a separate pass.  I'm not wedded to it, though.

Ian

Reply via email to