From patchwork Wed Oct 2 16:25:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Victor Do Nascimento X-Patchwork-Id: 1992090 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=A80D0CQW; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=A80D0CQW; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XJgDb6k98z1xtY for ; Thu, 3 Oct 2024 02:26:37 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 16F4B3858C39 for ; Wed, 2 Oct 2024 16:26:34 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2061e.outbound.protection.outlook.com [IPv6:2a01:111:f403:260d::61e]) by sourceware.org (Postfix) with ESMTPS id CF6253858D29 for ; Wed, 2 Oct 2024 16:26:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CF6253858D29 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org CF6253858D29 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:260d::61e ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1727886377; cv=pass; b=UFpZ0pi2FjV+1izya3NsbqoqbhzkG+Bc+uJaEcy8TQkiTrUZxlJ58a2te7PoHvYcXENaHcwYeaBbTMv3AP6j1GeEPm5084nwN3UrL97dy3uI1hWhKA27+a1R3joSAkAtQ6ooLVx1oKnX07WRhByxuNha/US/jkbmk+9DijkFCrs= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1727886377; c=relaxed/simple; bh=KbJjIj6x9xDIWWSbaVjXLrOmchIfDCbI/nj9uiZVPrA=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=IfHLvsXP+YP37H5G8Dxz80tpq3yxnGumb0B2d0cZDke9I/iuUyB7vK6iIjIwbmLW60MyBgUQNwmR4b1nq/YnArx7TgS4B1ijtjPv60GCgYhl5UO8ijjWzsHtZ6wSUAX2Rx1MnWMy+ItLPqgsv4+MAn6ltmjQWpzP07wu6asi3AU= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=qU1gK5yrBTU15cvqZTIAFztJdOAOBiYLvPxInpP0W+DjKWSrdOLRmEK9vCJyBBpgWWeEgRSjV328N/eTz+cgPn0pp2b3ZY+RweOEBpFV4zLd+1v0lBxkAvh3pKjLW6E1/GOHN/hAsDnANXsmzFTKSscqkv90ZCsdZPBvFOu8orl1hZPDT6eK0qo1pG709uFkEFlgx5GD74PREYBC94uDHv/7wB9VbK0oIgGFCO5+9p3oFmFWKAgKi1Sk0LwfCv9fjovozwcI0SVzAzq0YSQBE3W8PMWlduL5Zsg+Pm263Ks79MhyD++iC1pFPZ8OXKGSJPzK5CdoUct88l4xtyQe2Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=fnD4ngdqgACB3KfHzOuAEII4X73Ugu6AgOOCT3FVHGA=; b=vG34ZqrmTQ/akNqrpWyOkBsUs365Nn0arOqJEfMJb4aV/kUspryEjy0KcmBIYcXg2oPTJArhhvDRfzaYFCnVt1uqTuCaVyUXBXROTUyFWaDeKlxf+ezfII2zH4OjI66MDy+uJYszenbpcIObPFgC5vD5Jo4NC2Arb2qVa4iFr07CmRD4aRkLtkxvAqHMbkTWEtSTKWQuSJPwAMGHeQcDPOxL+7MXviMAEGNMF52bYMAe5Qp0MN36tafhjtIRF3H+Y2uLSMy/bVhbhHCh9MkoL8fngjfdDmMTK3YbuTfyBaSUzo6JAZlQDw8sSU0FwlQ3XoXztyjaF1Ckpbo7+v2nvQ== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=gcc.gnu.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dmarc=[1,1,header.from=arm.com]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fnD4ngdqgACB3KfHzOuAEII4X73Ugu6AgOOCT3FVHGA=; b=A80D0CQWKS8FjZIjEIt2Sx7p7QG1avfEyBLvWTDVkboq5mMTi6qlZuJQ+jDuwniKroBIik3xMXE9DRYvEOu/B9IlYpQQV2XSXavYMOLvsQ2OgUM3MbvG+Zy541yhUvui+otn0porY1dGmIRCJSyEvNqwN+65FpP94f5V5mYiG/I= Received: from AM4PR07CA0025.eurprd07.prod.outlook.com (2603:10a6:205:1::38) by DU0PR08MB7833.eurprd08.prod.outlook.com (2603:10a6:10:3b6::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.16; Wed, 2 Oct 2024 16:26:10 +0000 Received: from AM4PEPF00027A67.eurprd04.prod.outlook.com (2603:10a6:205:1:cafe::12) by AM4PR07CA0025.outlook.office365.com (2603:10a6:205:1::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.15 via Frontend Transport; Wed, 2 Oct 2024 16:26:10 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=arm.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM4PEPF00027A67.mail.protection.outlook.com (10.167.16.84) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8026.11 via Frontend Transport; Wed, 2 Oct 2024 16:26:08 +0000 Received: ("Tessian outbound 6c9d48238f96:v473"); Wed, 02 Oct 2024 16:26:08 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 2b46b16ceed1d8a1 X-TessianGatewayMetadata: yrRBvMsBDslVWHndVESOAxd3/ZvqqGNQHgXOpmeRuPhd/ZhnvF4f6iuRDcnpxHNeTF1pUkqwx2VwHzdna++//bdJAtXF/KC1F68USYooSyG8CI9OL84KbVMcBeuqniPyNlqJJEjmbOnJwytiW+LgPjV16i2XncntQ2sc5oTKX6HNeKGH5vNffT3rHHeo4r5+ X-CR-MTA-TID: 64aa7808 Received: from L10484a4650d1.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 1D2F987F-B4E9-49C0-89C0-86CC77A4F536.1; Wed, 02 Oct 2024 16:26:02 +0000 Received: from EUR03-AM7-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id L10484a4650d1.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 02 Oct 2024 16:26:02 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=V0NjgdCwxWRfHX2++o6Lp1Oz9klvgE3XLFv20jBvtHGsWkrzHRDKoBt0psVlG7RkLG77nvLizYawv1FmTZ9mwKZDu1EQ/ydv3+IoNCPwpv4jVJ4SBl+xpq8D4z+7grXiV+9ZnaIARgOhMdbuiwvDD+vRSsPGeimEetZ6zRjZEoCi/5AWL9Sy/Aex5DKGuLLBrvz+Gfy4Dt3UBBPSbCTz9WeLT6S1coXfF+MYuTTVHM9tMk5caD8ymZBoAuf444D7HQZt3Tv8SXA+SczpV8+/LxGffL0r/BfkZyMptJu+dA50zFCDTWcN4ZRafkUUYfEFFvpN2dA6bVvHRGzTwBR62w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=fnD4ngdqgACB3KfHzOuAEII4X73Ugu6AgOOCT3FVHGA=; b=Ke7vVJBpbenlrI/D5ZMu3aC9SCEZs6YAII5QQzooMq+lR3JLGgrXaljcLsE72DMY6ntyT4VMtltyIrtXZGpAgIUqzd94xgialzWpXUn8VUo0A5CgJTNdPFkrtuRNhSl8G2rY2hLw7ZunGDDqeEozxEg5DIh9F5+nTMwGeFaPCbzetKug0qx6w9LkOFZnX97IgfQjGUoarUb3UChB8hi4ZF09VzRx3KzQci59ul2eTN31DP2XANYicTifBeTRf6mbw5Umq7inMrZauMJO1al4ZtGBAhaCpnorBJ3UOam/xcj+1wA2ZKlt9qKz0C7KtTe2Nuj3elyqdezKGEB9SlQdfg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=gcc.gnu.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fnD4ngdqgACB3KfHzOuAEII4X73Ugu6AgOOCT3FVHGA=; b=A80D0CQWKS8FjZIjEIt2Sx7p7QG1avfEyBLvWTDVkboq5mMTi6qlZuJQ+jDuwniKroBIik3xMXE9DRYvEOu/B9IlYpQQV2XSXavYMOLvsQ2OgUM3MbvG+Zy541yhUvui+otn0porY1dGmIRCJSyEvNqwN+65FpP94f5V5mYiG/I= Received: from DB7PR02CA0023.eurprd02.prod.outlook.com (2603:10a6:10:52::36) by DBBPR08MB6203.eurprd08.prod.outlook.com (2603:10a6:10:201::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.15; Wed, 2 Oct 2024 16:25:57 +0000 Received: from DU2PEPF00028CFF.eurprd03.prod.outlook.com (2603:10a6:10:52:cafe::b6) by DB7PR02CA0023.outlook.office365.com (2603:10a6:10:52::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.29 via Frontend Transport; Wed, 2 Oct 2024 16:25:57 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C Received: from nebula.arm.com (40.67.248.234) by DU2PEPF00028CFF.mail.protection.outlook.com (10.167.242.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8026.11 via Frontend Transport; Wed, 2 Oct 2024 16:25:57 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 2 Oct 2024 16:25:55 +0000 Received: from e133397.arm.com (10.57.86.160) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Wed, 2 Oct 2024 16:25:55 +0000 From: Victor Do Nascimento To: CC: , , "Victor Do Nascimento" Subject: [PATCH] middle-end: reorder masking priority of math functions Date: Wed, 2 Oct 2024 17:25:51 +0100 Message-ID: <20241002162551.1575129-1-victor.donascimento@arm.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: DU2PEPF00028CFF:EE_|DBBPR08MB6203:EE_|AM4PEPF00027A67:EE_|DU0PR08MB7833:EE_ X-MS-Office365-Filtering-Correlation-Id: 9cc5c3c2-eb9c-4eae-4693-08dce2feebf9 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; ARA:13230040|82310400026|376014|1800799024|36860700013; X-Microsoft-Antispam-Message-Info-Original: OV8+t+YEWfRvkyrLrYQa9wiSrk2LyM+oIjynRx3J8N8hKS4wsxDq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pWYeBzX0eYoNQQgsVSli7PiA9+P8jnYKUuBd0pZM1QkLqA29xc9InI3FcfuHMN0o809QnHxBrXngYHwlb/ZFpPUfKQZQNddsUuifL3Caa+wCeE3nFQ8v2G7r7Ay6ifVBgglxAsezHUnLBSb10vmyW4qc9UKTiT0Npxb8gaD9J5BCOzPhSiWyLy9nJluZHUq2+uc+leoyASS1V X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:nebula.arm.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(82310400026)(376014)(1800799024)(36860700013); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB6203 X-MS-Exchange-SkipListedInternetSender: ip=[2603:10a6:10:52::36]; domain=DB7PR02CA0023.eurprd02.prod.outlook.com X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM4PEPF00027A67.eurprd04.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 0ea71025-b6ae-48c6-364f-08dce2fee55e X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|36860700013|35042699022|1800799024|82310400026; X-Microsoft-Antispam-Message-Info: 69aLDHh4mQ3l/YsErKQb1YLjCT/dgyQQrY/3P5T3ZYr4n34Cr8FaCKp3RRivLADR7lhAgJRQi5gqHWr0CcxNxtGGLv06urmI1OmTe90nfG+ZVxIFdTtQLtVVvjU+k9LfsKQsog5w0xo2SR9aJ8yw+nCodxxDCvTBgb9oCH1BG0xPu70DL42vPHgewR/ZJHkHsX5/HmF23NVcR6LJEsgNkUGYVuOnvMNhH+z82A6AVxho3NnAIeBEIX4+n4HsujXRka/gCRBgolRuh8hWIQyNjAU+fGC2NsR6IrJkn1gscZuadsW9+uiUoMenxls/MuEKfS+TthtRuJpdzX8f8zhHU/kke4LJhO4iL8gS1eakFZ9Aiix8ZLvoy7KprS4udJDgkL5EbJqG91N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-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(13230040)(376014)(36860700013)(35042699022)(1800799024)(82310400026); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Oct 2024 16:26:08.7070 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9cc5c3c2-eb9c-4eae-4693-08dce2feebf9 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM4PEPF00027A67.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB7833 X-Spam-Status: No, score=-13.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_NONE, TXREP, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org Given the categorization of math built-in functions as `ECF_CONST', when if-converting their uses, their calls are not masked and are thus called with an all-true predicate. This, however, is not appropriate where built-ins have library equivalents, wherein they may exhibit highly architecture-specific behaviors. For example, vectorized implementations may delegate the computation of values outside a certain acceptable numerical range to special (non-vectorized) routines which considerably slow down computation. As numerical simulation programs often do bounds check on input values prior to math calls, conditionally assigning default output values for out-of-bounds input and skipping the math call altogether, these fallback implementations should seldom be called in the execution of vectorized code. If, however, we don't apply any masking to these math functions, we end up effectively executing both if and else branches for these values, leading to considerable performance degradation on scientific workloads. We therefore invert the order of handling of math function calls in `if_convertible_stmt_p' to prioritize the handling of their library-provided implementations over the equivalent internal function. Regression tested on aarch64-none-linux-gnu & x86_64-linux-gnu w/ no new regressions. gcc/ChangeLog: * tree-if-conv.cc (if_convertible_stmt_p): Check for explicit function declaration before IFN fallback. gcc/testsuite/ChangeLog: * gcc.dg/vect/vect-fncall-mask-math.c: New. --- .../gcc.dg/vect/vect-fncall-mask-math.c | 33 +++++++++++++++++++ gcc/tree-if-conv.cc | 18 +++++----- 2 files changed, 42 insertions(+), 9 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/vect/vect-fncall-mask-math.c diff --git a/gcc/testsuite/gcc.dg/vect/vect-fncall-mask-math.c b/gcc/testsuite/gcc.dg/vect/vect-fncall-mask-math.c new file mode 100644 index 00000000000..15e22da2807 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/vect-fncall-mask-math.c @@ -0,0 +1,33 @@ +/* Test the correct application of masking to autovectorized math function calls. + Test is currently set to xfail pending the release of the relevant lmvec + support. */ +/* { dg-do compile { target { aarch64*-*-* } } } */ +/* { dg-additional-options "-march=armv8.2-a+sve -fdump-tree-ifcvt-raw -Ofast" { target { aarch64*-*-* } } } */ + +#include + +const int N = 20; +const float lim = 101.0; +const float cst = -1.0; +float tot = 0.0; + +float b[20]; +float a[20] = { [0 ... 9] = 1.7014118e39, /* If branch. */ + [10 ... 19] = 100.0 }; /* Else branch. */ + +int main (void) +{ + #pragma omp simd + for (int i = 0; i < N; i += 1) + { + if (a[i] > lim) + b[i] = cst; + else + b[i] = expf (a[i]); + tot += b[i]; + } + return (0); +} + +/* { dg-final { scan-tree-dump-not { gimple_call } ifcvt { xfail { aarch64*-*-* } } } } */ +/* { dg-final { scan-tree-dump { gimple_call <.MASK_CALL, _2, expf, _1, _30>} ifcvt { xfail { aarch64*-*-* } } } } */ diff --git a/gcc/tree-if-conv.cc b/gcc/tree-if-conv.cc index 3b04d1e8d34..90c754a4814 100644 --- a/gcc/tree-if-conv.cc +++ b/gcc/tree-if-conv.cc @@ -1133,15 +1133,6 @@ if_convertible_stmt_p (gimple *stmt, vec refs) case GIMPLE_CALL: { - /* There are some IFN_s that are used to replace builtins but have the - same semantics. Even if MASK_CALL cannot handle them vectorable_call - will insert the proper selection, so do not block conversion. */ - int flags = gimple_call_flags (stmt); - if ((flags & ECF_CONST) - && !(flags & ECF_LOOPING_CONST_OR_PURE) - && gimple_call_combined_fn (stmt) != CFN_LAST) - return true; - tree fndecl = gimple_call_fndecl (stmt); if (fndecl) { @@ -1160,6 +1151,15 @@ if_convertible_stmt_p (gimple *stmt, vec refs) } } + /* There are some IFN_s that are used to replace builtins but have the + same semantics. Even if MASK_CALL cannot handle them vectorable_call + will insert the proper selection, so do not block conversion. */ + int flags = gimple_call_flags (stmt); + if ((flags & ECF_CONST) + && !(flags & ECF_LOOPING_CONST_OR_PURE) + && gimple_call_combined_fn (stmt) != CFN_LAST) + return true; + return false; }