From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23419 invoked by alias); 30 Aug 2017 18:39:00 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 23356 invoked by uid 89); 30 Aug 2017 18:38:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.7 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-wm0-f43.google.com Received: from mail-wm0-f43.google.com (HELO mail-wm0-f43.google.com) (74.125.82.43) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 30 Aug 2017 18:38:49 +0000 Received: by mail-wm0-f43.google.com with SMTP id u126so15163788wmg.1 for ; Wed, 30 Aug 2017 11:38:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:mail-followup-to:cc:subject:references :date:in-reply-to:message-id:user-agent:mime-version; bh=YYdqZICnuieWc/eldq/vrF1SonLiv2abtrlGVvr5XT0=; b=m2U+nxAFdHs8CKQZ/a3d2v99QRaqBXcsO+o28BAWUN/F8Kk2zHUjvVORMbYBqTrl87 bqWUN9QFFSVnYwRemOhtuI7s/q1RV7AujXJwAb0ITyvjiKeeH0xm98Crk8QOIZR98j9g O6xgOcNI2Th5cPcXVBGCImaj4N4gZBRT3NWAZ3k+9e+1uiOR+C82Nxpg04yPmJte0Hfu rj5Klo8sRoStF1auTrqA+/gDG3kmMBKx2yCaRloexPcUqyiZbCB1Nd6VGRSLHxTBo1kQ V6wSD1+fqK2MSyJBRrS3f3ZypssuvWhIBEMEmuF04uH1eCm5Z+oqTGzyRcs4p3VPqOwV 4gWg== X-Gm-Message-State: AHYfb5iTIK/69yx6wHWdiU0xLUNkQHzxtBOlbcHxzNFKQdcAhbR4vbps yDPjkef8si50xXPJN/9rEw== X-Received: by 10.28.223.11 with SMTP id w11mr1715687wmg.170.1504118327051; Wed, 30 Aug 2017 11:38:47 -0700 (PDT) Received: from localhost ([95.145.139.63]) by smtp.gmail.com with ESMTPSA id c20sm3471062wra.92.2017.08.30.11.38.45 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 30 Aug 2017 11:38:46 -0700 (PDT) From: Richard Sandiford To: "Jon Beniston" Mail-Followup-To: "Jon Beniston" ,"'Richard Biener'" , , richard.sandiford@linaro.org Cc: "'Richard Biener'" , Subject: Re: [RFC, vectorizer] Allow single element vector types for vector reduction operations References: <015b01d31f6b$c3651620$4a2f4260$@beniston.com> <000001d31fd7$b239abb0$16ad0310$@beniston.com> <004501d3217d$119d81c0$34d88540$@beniston.com> <00ba01d321a2$3fd81260$bf883720$@beniston.com> Date: Wed, 30 Aug 2017 20:42:00 -0000 In-Reply-To: <00ba01d321a2$3fd81260$bf883720$@beniston.com> (Jon Beniston's message of "Wed, 30 Aug 2017 16:11:24 +0100") Message-ID: <87wp5kyk7g.fsf@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2017-08/txt/msg01752.txt.bz2 "Jon Beniston" writes: > Hi Richard, > >> I think the issue is that with TARGET_VECTOR_MODE_SUPPORTED_P false >> for V1SI you'll get a SImode vector type and the >> >> if (VECTOR_BOOLEAN_TYPE_P (type_in) >> || VECTOR_MODE_P (TYPE_MODE (type_in))) >> >>check fails. Try changing that to || VECTOR_TYPE_P (type_in). >>The else path should be hopefully dead ... >> >>> It looks to me like the other call sites of optab_for_tree_code which >>> are passing optab_default are mostly places where GCC is sure it is >>> not a shift operation. >>> Given TYPE_IN is returned from get_vectype_for_scalar_type, is it >>> safe to simply pass optab_vector in vect_pattern_recog_1? >> >>I guess so. Can you also try the above? > > Changing VECTOR_MODE_P check into VECTOR_TYPE_P check also works for me, I > verified the following patch could vectorize my dot product case and there > is no regression on gcc tests on my port. > > Meanwhile x86-64 bootstraps OK and no regression on gcc/g++ test. > > Does this look OK? > > > gcc/ > 2017-08-30 Jon Beniston > Richard Biener > > diff --git a/gcc/tree-vect-patterns.c b/gcc/tree-vect-patterns.c > index cfdb72c..5ebeac2 100644 > --- a/gcc/tree-vect-patterns.c > +++ b/gcc/tree-vect-patterns.c > @@ -4150,7 +4150,7 @@ vect_pattern_recog_1 (vect_recog_func *recog_func, > loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info); > > if (VECTOR_BOOLEAN_TYPE_P (type_in) > - || VECTOR_MODE_P (TYPE_MODE (type_in))) > + || VECTOR_TYPE_P (type_in)) > { > /* No need to check target support (already checked by the pattern > recognition function). */ It looks like this makes the VECTOR_BOOLEAN_TYPE_P (type_in) check redundant. Thanks, Richard