This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 3/3] Compute predicates for phi node results in ipa-inline-analysis.c
Hi,
On Fri, Aug 31, 2012 at 10:52:28AM +0200, Jan Hubicka wrote:
> > Hi,
> >
> > this is a new version of the patch which makes ipa analysis produce
> > predicates for PHI node results, at least at the bottom of the
> > simplest diamond and semi-diamond CFG subgraphs. This time I also
> > analyze the conditions again rather than extracting information from
> > CFG edges, which means I can reason about substantially more PHI
> > nodes.
> >
> > This patch makes us produce loop bounds hint for the pr48636.f90
> > testcase.
> >
> > Bootstrapped and tested on x86_64-linux. OK for trunk?
>
> OK,
> thanks! Do you think you can add testcase?
Thanks, I forgot to include the testcase in the email somehow, I have
committed the changes to pr48636.f90 below along with the patch.
> I plan to reorg the analysis to work in dominator order (now we compute
> dominators anyway for lop analysis) that will make this also bit more strong
> across non-trivial CFGs. (originally I did not care much since inliner cares
> only about simple functions with simple CFG, but with inline hints and other
> stuff we need to be more careful to not throw away useful info.
Well, evaluating the GIMPLE_COND rather than disecting the predicates
in an e->aux also makes for much nicer code. However, processing in
dominator order is certainly a good idea.
Martin
Index: src/gcc/testsuite/gfortran.dg/pr48636.f90
===================================================================
--- src.orig/gcc/testsuite/gfortran.dg/pr48636.f90
+++ src/gcc/testsuite/gfortran.dg/pr48636.f90
@@ -1,5 +1,5 @@
! { dg-do compile }
-! { dg-options "-O3 -fdump-ipa-inline" }
+! { dg-options "-O3 -fdump-ipa-inline-details" }
module foo
implicit none
@@ -34,4 +34,6 @@ program main
end program main
! { dg-final { scan-ipa-dump "bar\[^\\n\]*inline copy in MAIN" "inline" } }
+! { dg-final { scan-ipa-dump-times "phi predicate:" 5 "inline" } }
+! { dg-final { scan-ipa-dump "inline hints: loop_iterations" "inline" } }
! { dg-final { cleanup-ipa-dump "inline" } }