This is the mail archive of the gcc-patches@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]

Re: code improvement for rs6000 FP const generation



On Wednesday, May 16, 2001, at 01:48  PM, Richard Henderson wrote:
> On Wed, May 16, 2001 at 01:34:41PM -0700, Dale Johannesen wrote:
[ when I tried match_operand 0 as per RH's statement, this happened:]
>> ./genrecog ../../gcc3/gcc/config/rs6000/rs6000.md > tmp-recog.c
>> ../../gcc3/gcc/config/rs6000/rs6000.md:9138: operand 0 missing output
>> reload
>
> Really?  That would be a bug.  Sure enough, validate_pattern
> doesn't check what kind of input pattern it is...

Yep, really.  In the meantime, match_scratch does work, although that 
may be accidental...Who gets to fix the bug?

>> I want to match only if op0 is dead, of course, but I would expect the
>> peep2_reg_dead_p() call to take care of that.
>
> Yep.  Actually, you probably want to match *even if* op0 is live.
> Given the peephole is matching, the instructions must be adjacent.
> By changing (oh, i forget the ppc syntax)
>
> 	lda  r3,%lo16(sym)(r4)
> 	ldf  f5,0(r3)
> to
> 	lda  r3,%lo16(sym)(r4)
> 	ldf  f5,%lo16(sym)(r4)
>
> you've reduced the depenancy graph, and allow better schedules.
> You do want to check for death though, since flow2 has already
> run and there's nothing else to remove the dead code.

Good point, thanks.

>  Also, in
> the live case have to check that op0 != op1.

Nah, just switch the instructions wlog:
	ldf  f5,%lo16(sym)(r4)
	lda  r4,%lo16(sym)(r4)
(although I'm not sure the live case can actually occur)

Incidentally, I don't think peephole2's nonuse of constraints is 
documented anywhere.   For that matter, shouldn't they be removed from 
the syntax?


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