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: [tree-ssa] Simple value range propagation for tree-ssa-dom


In message <16250.46575.720716.405975@cuddles.cambridge.redhat.com>, Andrew Hal
ey writes:
 >I was hoping that this would cause redundant checks like this to be
 >removed:
 >
 >int a[10];
 >
 >int foo ()
 >{
 >  int j;
 >  int m=0;
 >  for (j=0; j<10;j++)
 >    {
 >      if (j < 0)
 >	abort();
 >      if (j > 10)
 >	abort();
 >      m+=a[j];
 >    }
 >  return m;
 >}
We don't currently merge ranges at PHI nodes, nor do we track ranges for
outputs of statements within a basic block.  To optimize a loop like that
we have to merge ranges as PHI nodes and possibly look at statemetns within
blocks to build ranges for their outputs.

It's on the todo list, but it's after some other (non-VRP) work.

jeff


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