This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix for PR64081 in RTL loop unroller
- From: Jeff Law <law at redhat dot com>
- To: "Zamyatin, Igor" <igor dot zamyatin at intel dot com>, "GCC Patches (gcc-patches at gcc dot gnu dot org)" <gcc-patches at gcc dot gnu dot org>
- Cc: "ysrumyan at gmail dot com" <ysrumyan at gmail dot com>
- Date: Fri, 16 Jan 2015 09:46:05 -0700
- Subject: Re: [PATCH] Fix for PR64081 in RTL loop unroller
- Authentication-results: sourceware.org; auth=none
- References: <0EFAB2BDD0F67E4FB6CCC8B9F87D756969CF7BFC at IRSMSX101 dot ger dot corp dot intel dot com> <54AF707D dot 6080800 at redhat dot com> <CAEoMCqTzzMz-qO5x1q=5Htjxe1Von02iB_BpW7umXyQy_nVxtw at mail dot gmail dot com> <CAKdSQZnrxfXcUMXwNW=c0PPaFgFe6rUKhkW+2T1U8BKop8K8=A at mail dot gmail dot com> <0EFAB2BDD0F67E4FB6CCC8B9F87D756969D345EB at IRSMSX101 dot ger dot corp dot intel dot com> <54B56C44 dot 8090707 at redhat dot com> <0EFAB2BDD0F67E4FB6CCC8B9F87D756969D3B5CA at IRSMSX101 dot ger dot corp dot intel dot com> <54B7ED0C dot 8000808 at redhat dot com> <0EFAB2BDD0F67E4FB6CCC8B9F87D756969D4B971 at IRSMSX101 dot ger dot corp dot intel dot com>
On 01/16/15 08:16, Zamyatin, Igor wrote:
Not sure it's possible to merge DF_REG_DEF_CHAIN walk and
DF_REF_CHAIN walk...
OK. Just use the same overall structure if we can't pull the test out into a
single function that could be called from both places.
Thanks, is updated patch ok for trunk?
Igor
Changelog:
gcc
2015-01-16 Igor Zamyatin <igor.zamyatin@intel.com>
PR rtl-optimization/64081
* loop-iv.c (def_pred_latch_p): New function.
(latch_dominating_def): Allow specific cases with non-single
definitions.
(iv_get_reaching_def): Likewise.
(check_complex_exit_p): New function.
(check_simple_exit): Use check_complex_exit_p to allow certain cases
with exits not executing on any iteration.
testsuite
2014-01-16 Igor Zamyatin <igor.zamyatin@intel.com>
PR rtl-optimization/64081
* gcc.dg/pr64081.c: New test.
Just a few nits below. Approved with the nits fixed.
+/* Checks that def is in an immediate predecessor of the latch block. */
+
+static bool
+def_pred_latch_p (df_ref d_ref)
Use the actual parameter name in the comment and put it in caps, mention
the return values. Something like this:
/* Return true if D_REF is defined in an immediate predecessor of the
current loop's latch block. Otherwise return false. */
+ /* If we have single definition it has to be excuted on each iteration. */
s/excuted/executed/
+/* Check whether exit is not simple but still good for further analysis.
+ Looks like such loops mostly are a result of jump threading. */
+
+static bool
+check_complex_exit_p (struct loop* loop, basic_block bb)
/* Return true if LOOP has a complex exit, but is still good for further
analysis. Return false otherwise. BB is LOOP's exit block. */
With those comment fixes, this is OK for the trunk.
Thanks,
Jeff