And Below is the ChangeLog entry for test cases
gcc/testsuite/ChangeLog
2016-06-07 Bin Cheng <[email protected]>
* gcc.dg/vect/vect-35-big-array.c: Refine comment and test.
* gcc.dg/vect/vect-35.c: Ditto.
BTW, this patch also makes gcc.dg/vect/vect-mask-store-move-1.c fail, but I
think it just exposes existing issue in PR65206. Vectorizer's dependence
analyzer should be fixed for this.
Thanks,
bin
> From: [email protected] <[email protected]> on behalf
> of Bin Cheng <[email protected]>
> Sent: 13 June 2016 11:01
> To: [email protected]
> Cc: nd
> Subject: [PATCH GCC]Resolve compilation time known alias checks in vectorizer
>
> Hi,
> GCC vectorizer generates many unnecessary runtime alias checks known at
> compilation time. For some data-reference pairs, alias relation can be
> resolved at compilation time, in this case, we can
> simply skip the alias check. For some other data-reference pairs, alias
> relation can be realized at compilation time, in this case, we should return
> false and simply skip vectorizing the loop. For the second
> case, the corresponding loop is vectorized for nothing because the guard
> alias condition is bound to false anyway. Vectorizing it not only wastes
> compilation time, but also slows down generated code
> because GCC fails to resolve these "false" alias check after vectorization.
> Even in cases it can be resolved (by VRP), GCC fails to cleanup all the mess
> generated in loop versioning.
> This looks like a common issue in spec2k6. For example, in
> 434.zeusmp/ggen.f, there are three loops vectorized but never executed; in
> 464.h264ref, there are loops in which all runtime alias checks are
> resolved at compilation time thus loop versioning is proven unnecessary.
> Statistic data also shows that about >100 loops are falsely vectorized
> currently in my build of spec2k6.
>
> This patch is based on
> https://gcc.gnu.org/ml/gcc-patches/2016-06/msg00399.html, bootstrap and test
> on x86_64 and AArch64 (ongoing), is it OK?
>
> Thanks,
> bin
>
> 2016-06-07 Bin Cheng <[email protected]>
>
> * tree-vect-data-refs.c (vect_no_alias_p): New function.
> (vect_prune_runtime_alias_test_list): Call vect_no_alias_p to
> resolve alias checks which are known at compilation time.
> Truncate vector LOOP_VINFO_MAY_ALIAS_DDRS(loop_vinfo) if all
> alias checks are resolved at compilation time.