[patch, vect] Support multiple types in SLP and generalize multi-step conversion

Richard Guenther richard.guenther@gmail.com
Mon Aug 18 10:10:00 GMT 2008


On Mon, Aug 18, 2008 at 10:59 AM, Ira Rosen <IRAR@il.ibm.com> wrote:
>
> Hi,
>
> This patch adds support of loops with multiple types in loop-aware SLP and
> generalizes multi-step type conversions (for all types of vectorization).
>
> In order to support multiple types in an SLP instance, the number of vector
> statements to be generated is now calculated for every SLP node according
> to the scalar type of the node statements, and the promotion/demotion
> operations take care of the transition between different data types.
>
> This patch also makes double step type conversion (
> http://gcc.gnu.org/ml/gcc-patches/2008-08/msg00691.html) more general,
> allowing more than one intermediate step in conversion (e.g., conversion
> from long long to char). Since this part touches the same code as the code
> for SLP (in vectorizable_type_demotion/promotion), I put it in the same
> patch.
>
> Is there a standard utility in GCC to compute pow? I didn't find any, so I
> added vect_pow2 in tree-vectorizer.h...
>
> Bootstrapped with vectorization enabled and tested on vectorizer testsuite
> on ppc-linux and x86-linux. Fully tested on x86-linux.
> O.K. for mainline?

Please don't add further tests which have constant initialized local data,
instead make that global data.  Otherwise the compiler might at one
point decide to unroll all loops completely because it then can compute
all of the functions at compile-time.  (Yes, I run into this again now ... :/)

So, instead of

+int
+main1 ()
+{
+  int i;
+  unsigned int out[N*8];
+  unsigned int in[N*8] =
{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+  unsigned char in2[N*8] =
{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+  unsigned char out2[N*8];

do

+  unsigned int in[N*8] =
{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+  unsigned char in2[N*8] =
{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};

+int
+main1 ()
+{
+  int i;
+  unsigned int out[N*8];
+  unsigned char out2[N*8];
+

Thanks,
Richard.



More information about the Gcc-patches mailing list