From patchwork Tue Oct 23 08:57:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 988079 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-488094-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="j+OVoPmC"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42fS2j0l1dz9sNR for ; Tue, 23 Oct 2018 19:57:46 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=Md5yI6spJRA3s1RQW80TcWkqSSY0HkJNgspks39zpXuCZaTPmeUU2 6jzsALKqi80/ceSvTJ3c4cM8g4XyP8uhkDuHFscLL6yPTPBhdCxTO6kqVbdlUs38 fiWUMDrSAboR7vEHKQOFpXJifk2r3YIa3FWtnB91xxVqHIBR5mogak= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=uyP1yYXSJgzcOtvRubXnlHtrvqg=; b=j+OVoPmCfmQJxKpOtXPq bQc+3ZrJoUplBoTF5ho5LpNgaxHUcQs3L41R51cJZCKaLonqew53p/RawXB2z2Py i3L/zcKK2wpF8SHEtWpvLdTyzfYsT5M/IHIQnjbRK/hRSbIBu29p5pNjsdR5FT+D MGkSNYMCpfGxSZelYlH1SW0= Received: (qmail 110154 invoked by alias); 23 Oct 2018 08:57:39 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 110138 invoked by uid 89); 23 Oct 2018 08:57:39 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.4 required=5.0 tests=BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.suse.de Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 23 Oct 2018 08:57:38 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 11C22ACCC for ; Tue, 23 Oct 2018 08:57:36 +0000 (UTC) Date: Tue, 23 Oct 2018 10:57:34 +0200 (CEST) From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix PR86144 Message-ID: User-Agent: Alpine 2.20 (LSU 67 2015-01-07) MIME-Version: 1.0 In this PR it was requested that -mveclibabi=svml takes precedence over simd annotations of which is a reasonable expectation. Bootstrapped and tested on x86_64-unknown-linux-gnu, applied. Richard. 2018-10-23 Richard Biener PR tree-optimization/86144 * tree-vect-stmts.c (vect_analyze_stmt): Prefer -mveclibabi over simd attribute. Index: gcc/tree-vect-stmts.c =================================================================== --- gcc/tree-vect-stmts.c (revision 265411) +++ gcc/tree-vect-stmts.c (working copy) @@ -9533,14 +9533,18 @@ vect_analyze_stmt (stmt_vec_info stmt_in if (!bb_vinfo && (STMT_VINFO_RELEVANT_P (stmt_info) || STMT_VINFO_DEF_TYPE (stmt_info) == vect_reduction_def)) - ok = (vectorizable_simd_clone_call (stmt_info, NULL, NULL, node, cost_vec) + /* Prefer vectorizable_call over vectorizable_simd_clone_call so + -mveclibabi= takes preference over ibrary functions with + the simd attribute. */ + ok = (vectorizable_call (stmt_info, NULL, NULL, node, cost_vec) + || vectorizable_simd_clone_call (stmt_info, NULL, NULL, node, + cost_vec) || vectorizable_conversion (stmt_info, NULL, NULL, node, cost_vec) || vectorizable_shift (stmt_info, NULL, NULL, node, cost_vec) || vectorizable_operation (stmt_info, NULL, NULL, node, cost_vec) || vectorizable_assignment (stmt_info, NULL, NULL, node, cost_vec) || vectorizable_load (stmt_info, NULL, NULL, node, node_instance, cost_vec) - || vectorizable_call (stmt_info, NULL, NULL, node, cost_vec) || vectorizable_store (stmt_info, NULL, NULL, node, cost_vec) || vectorizable_reduction (stmt_info, NULL, NULL, node, node_instance, cost_vec) @@ -9552,8 +9556,9 @@ vect_analyze_stmt (stmt_vec_info stmt_in else { if (bb_vinfo) - ok = (vectorizable_simd_clone_call (stmt_info, NULL, NULL, node, - cost_vec) + ok = (vectorizable_call (stmt_info, NULL, NULL, node, cost_vec) + || vectorizable_simd_clone_call (stmt_info, NULL, NULL, node, + cost_vec) || vectorizable_conversion (stmt_info, NULL, NULL, node, cost_vec) || vectorizable_shift (stmt_info, NULL, NULL, node, cost_vec) @@ -9562,7 +9567,6 @@ vect_analyze_stmt (stmt_vec_info stmt_in cost_vec) || vectorizable_load (stmt_info, NULL, NULL, node, node_instance, cost_vec) - || vectorizable_call (stmt_info, NULL, NULL, node, cost_vec) || vectorizable_store (stmt_info, NULL, NULL, node, cost_vec) || vectorizable_condition (stmt_info, NULL, NULL, NULL, 0, node, cost_vec)