diff mbox series

vect: Skip epilogue loops for dbgcnt check [PR96451]

Message ID b72af5f2-f58c-ff5c-2b9f-d8ebfee46d1b@linux.ibm.com
State New
Headers show
Series vect: Skip epilogue loops for dbgcnt check [PR96451] | expand

Commit Message

Kewen.Lin Aug. 5, 2020, 7:48 a.m. UTC
Hi,

As the PR shows, commit r11-2453 exposed one issue that vectorizer
wants to vectorize the epilogue loop and leaves the if-cvt body there,
but later dbgcnt check disables it, the left scalar mask_store
statement cause ICE.

As Richard pointed out in that PR, the dbgcnt is to count original
scalar loops, so this fix is to make it skip the epilogue loops.

Testing just launched, is it OK for trunk if everthing goes well?

BR,
Kewen
-----

gcc/ChangeLog:

	* tree-vectorizer.c (try_vectorize_loop_1): Skip the epilogue loops
	for dbgcnt check.

-----

Comments

Richard Biener Aug. 5, 2020, 9:01 a.m. UTC | #1
On Wed, Aug 5, 2020 at 9:48 AM Kewen.Lin <linkw@linux.ibm.com> wrote:
>
> Hi,
>
> As the PR shows, commit r11-2453 exposed one issue that vectorizer
> wants to vectorize the epilogue loop and leaves the if-cvt body there,
> but later dbgcnt check disables it, the left scalar mask_store
> statement cause ICE.
>
> As Richard pointed out in that PR, the dbgcnt is to count original
> scalar loops, so this fix is to make it skip the epilogue loops.
>
> Testing just launched, is it OK for trunk if everthing goes well?

OK.

Thanks,
Richard.

> BR,
> Kewen
> -----
>
> gcc/ChangeLog:
>
>         * tree-vectorizer.c (try_vectorize_loop_1): Skip the epilogue loops
>         for dbgcnt check.
>
> -----
> diff --git a/gcc/tree-vectorizer.c b/gcc/tree-vectorizer.c
> index 26a184696aa..1e9f46148ca 100644
> --- a/gcc/tree-vectorizer.c
> +++ b/gcc/tree-vectorizer.c
> @@ -1066,7 +1066,8 @@ try_vectorize_loop_1 (hash_table<simduid_to_vf> *&simduid_to_vf_htab,
>        return ret;
>      }
>
> -  if (!dbg_cnt (vect_loop))
> +  /* Only count the original scalar loops.  */
> +  if (!LOOP_VINFO_EPILOGUE_P (loop_vinfo) && !dbg_cnt (vect_loop))
>      {
>        /* Free existing information if loop is analyzed with some
>          assumptions.  */
diff mbox series

Patch

diff --git a/gcc/tree-vectorizer.c b/gcc/tree-vectorizer.c
index 26a184696aa..1e9f46148ca 100644
--- a/gcc/tree-vectorizer.c
+++ b/gcc/tree-vectorizer.c
@@ -1066,7 +1066,8 @@  try_vectorize_loop_1 (hash_table<simduid_to_vf> *&simduid_to_vf_htab,
       return ret;
     }

-  if (!dbg_cnt (vect_loop))
+  /* Only count the original scalar loops.  */
+  if (!LOOP_VINFO_EPILOGUE_P (loop_vinfo) && !dbg_cnt (vect_loop))
     {
       /* Free existing information if loop is analyzed with some
	 assumptions.  */