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]
Other format: [Raw text]

Re: VRP speedup


Hi,
> 
> This should be return -2 (at least you check for that below and the
> comment says so).  The patch also looks more like a hack to me ;)

Yes, it should.  I've fixed it and re-testing.

> But I guess until someone fixes fold-const.c to provide a special
> fold-to-constant for comparisons it's still ok.

The main motivation was to get the integer constants inline (the whole
thing is rarely used for something else, since mostly we compare ranges
with ranges and those do have integer bounds).
I guess we can somehow tweak the fold-cost interface for this but it is
bit tricky too.
> 
> Please use cmp1 == 1 here.

Also fixed.
> 
> >!   cmp2 = fast_lt_compare (vr->max, val);
> >!   if (cmp2 == -2)
> >      return -2;
> >
> >!   return !cmp2;
> 
> Likewise.  A comment on how this models inside-range would also be nice.

There is comment above the function that it basically check
min<=val<=max
this is just implementation of it, but if you have idea how to make it
cleaner...
> 
> >  }
> >
> >
> >  /* Return true if value ranges VR0 and VR1 have a non-empty
> >!    intersection.
> >!
> >!    Benchmark compile/20001226-1.c compilation time after changing this
> >!    function.
> >!    */
> 
> Btw - are these comment changes a reminder for youself?  I don't think
> they belong here (and above).

I just wanted to have comment here that this function tend to be real
hot and it seemed useful to mention here.  These are probably going to
change if we want to support FP ranges in future so there is risk that
they will become slow again.

I can drop the comment however.  Thanks,
Honza


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