This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, PR tree-optimization/68327] Compute vectype for live phi nodes when copmputing VF
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Ilya Enkovich <enkovich dot gnu at gmail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 20 Nov 2015 12:28:27 +0100
- Subject: Re: [PATCH, PR tree-optimization/68327] Compute vectype for live phi nodes when copmputing VF
- Authentication-results: sourceware.org; auth=none
- References: <20151118110701 dot GB42296 at msticlxl57 dot ims dot intel dot com> <CAFiYyc03hAX76JyZQghmMNufspWyvwUBaYLE-ZUQ7=jkwqcmbQ at mail dot gmail dot com> <CAMbmDYb5n3f9=AWX=Pd18nXhGepu=EttRuF6QrNyQXsw54L=Yw at mail dot gmail dot com>
On Wed, Nov 18, 2015 at 2:53 PM, Ilya Enkovich <enkovich.gnu@gmail.com> wrote:
> 2015-11-18 16:44 GMT+03:00 Richard Biener <richard.guenther@gmail.com>:
>> On Wed, Nov 18, 2015 at 12:34 PM, Ilya Enkovich <enkovich.gnu@gmail.com> wrote:
>>> Hi,
>>>
>>> When we compute vectypes we skip non-relevant phi nodes. But we process non-relevant alive statements and thus may need vectype of non-relevant live phi node to compute mask vectype. This patch enables vectype computation for live phi nodes. Botostrapped and regtested on x86_64-unknown-linux-gnu. OK for trunk?
>>
>> Hmm. What breaks if you instead skip all !relevant stmts and not
>> compute vectype for life but not relevant ones? We won't ever
>> "vectorize" !relevant ones, that is, we don't need their vector type.
>
> I tried it and got regression in SLP. It expected non-null vectype
> for non-releveant but live statement. Regression was in
> gcc/gcc/testsuite/gfortran.fortran-torture/execute/pr43390.f90
Because somebody put a vector type check before
if (!STMT_VINFO_RELEVANT_P (stmt_info) && !bb_vinfo)
return false;
@@ -7590,6 +7651,9 @@ vectorizable_comparison (gimple *stmt, g
tree mask_type;
tree mask;
+ if (!STMT_VINFO_RELEVANT_P (stmt_info) && !bb_vinfo)
+ return false;
+
if (!VECTOR_BOOLEAN_TYPE_P (vectype))
return false;
@@ -7602,8 +7666,6 @@ vectorizable_comparison (gimple *stmt, g
ncopies = LOOP_VINFO_VECT_FACTOR (loop_vinfo) / nunits;
gcc_assert (ncopies >= 1);
- if (!STMT_VINFO_RELEVANT_P (stmt_info) && !bb_vinfo)
- return false;
if (STMT_VINFO_DEF_TYPE (stmt_info) != vect_internal_def
&& !(STMT_VINFO_DEF_TYPE (stmt_info) == vect_nested_cycle
fixes this particular fallout for me.
Richard.
> Ilya
>
>>
>> Richard.
>>
>>> Thanks,
>>> Ilya