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 case that PRE optimization hurts performance


> > * Without PRE,
> >
> > Path1:
> > ? ? ? ?movl ? ?$2, %eax
> > ? ? ? ?cmpl ? ?$1, %eax
> > ? ? ? ?je ? ? ?.L3
> >
> > Path2:
> > ? ? ? ?movb ? ?$3, %al
> > ? ? ? ?cmpl ? ?$1, %eax
> > ? ? ? ?je ? ? ?.L3
> >
> > Path3:
> > ? ? ? ?cmpl ? ?$1, %eax
> > ? ? ? ?jne ? ? .L14
> >
> > * With PRE,
> >
> > Path1:
> > ? ? ? ?movl ? ?$1, %ebx
> > ? ? ? ?movl ? ?$2, %eax
> > ? ? ? ?testb ? %bl, %bl
> > ? ? ? ?je ? ? ?.L3
> >
> > Path2:
> > ? ? ? ?movl ? ?$1, %ebx
> > ? ? ? ?movb ? ?$3, %al
> > ? ? ? ?testb ? %bl, %bl
> > ? ? ? ?je ? ? ?.L3
> >
> > Path3:
> > ? ? ? ?cmpl ? ?$1, %eax
> > ? ? ? ?setne ? %bl
> > ? ? ? ?testb ? %bl, %bl
> > ? ? ? ?jne ? ? .L14
> >
> > Do you have any more thoughts?
> 
> It seems to me that with PRE all the testb %bl, %bl
> should be evaluated at compile-time considering the
> preceeding movl $1, %ebx.  Am I missing something?
> 

Yes. Can this be done by PRE or any other optimizations in middle end?

Thanks,
-Jiangning

> Richard.
> 





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