From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2043.outbound.protection.outlook.com [40.107.20.43]) by sourceware.org (Postfix) with ESMTPS id EFFA73858D32 for ; Mon, 27 Feb 2023 12:32:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EFFA73858D32 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AB2S/69CNh3ivZN/JJo+kSXu+kXOcQhx8crrH2XvhJ4=; b=6X9+proGSjC86mRyOf4tHttcso7OQLnn3VlBOHl0WD3qYOX3fV130J+XCf06Iu0p105SfyQTzn4sfixoCfjwgj5WwT0JPaS2HQazs73UeNWEWRedw5yGFjApYWLWUjhoWHov7j8dMEH+AQavojMvTy+ldG57WP4CzzrsMMIIG9Y= Received: from AM6P193CA0128.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:85::33) by DB9PR08MB6620.eurprd08.prod.outlook.com (2603:10a6:10:256::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.29; Mon, 27 Feb 2023 12:32:52 +0000 Received: from AM7EUR03FT061.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:85:cafe::ee) by AM6P193CA0128.outlook.office365.com (2603:10a6:209:85::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.29 via Frontend Transport; Mon, 27 Feb 2023 12:32:52 +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=armh.onmicrosoft.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 AM7EUR03FT061.mail.protection.outlook.com (100.127.140.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.16 via Frontend Transport; Mon, 27 Feb 2023 12:32:52 +0000 Received: ("Tessian outbound 43b0faad5a68:v132"); Mon, 27 Feb 2023 12:32:51 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: c4ef34ba838410a0 X-CR-MTA-TID: 64aa7808 Received: from 2617f3c68812.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 87770EFC-54A3-49D5-9C78-936473524EC5.1; Mon, 27 Feb 2023 12:32:45 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 2617f3c68812.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 27 Feb 2023 12:32:45 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IYCn5fd/vt8D6gcTRzy4eSOKOXqqJrPnlKVGK5B+BWa1WlwTJt0JhhuZfTwOGSVaMHEP/0r+fRy0efvRV0SN3XiYm1SiE5DCxuflQ6mDrW2FS+/dYb/Duo98vCQA6Jp8YrdMrxFx4pM84oiLZg4XNK1buxbVmbmsd99tSY8zP8UnruqbzrE4wG3vWX1us+LtM+o1uOY6bUHNcgfUWmi6kReHqj0uzL6J6Ml1grTHs6m1IcWTTIYVIa05nAffe5+u8AtQJcnyHFmNl1841GF5Se3UPIqXTViHDzrx+44HTvdOvVXzpd6/+jJQGUw6rqfv4zMh64TSUyWIudvMq/AaWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=AB2S/69CNh3ivZN/JJo+kSXu+kXOcQhx8crrH2XvhJ4=; b=TdyuXfHK3CkT9x1+n8hghrXhWI7RNfD85DRR4tukZjynv1wxcOuh4YfeUa8PrX6vrADXM4htB4oV+ZoTKtF6SiAJYSViFE4FtOIJ2/J1owDIH8UloY0DN2v8ZshbE4K7p0O41dNN2NKgTxNPMV9IulYO5CqIdhfGQrlmR/chgH599AAgfFMBYWYRqeosfAqWIcwuQeHlH8DHMVCmHXa3jymVjiOLIKm0I3iKon9rGLs3F/uy3hBFNK8s9+ecBAD4CAqZ59e/XYEQyK0QKCaQCe4fhm5qD7mZP58a60h1No3zvmVPFcc7fjULxhNXYAh03fPVhpam+634mIlXB+D/4w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AB2S/69CNh3ivZN/JJo+kSXu+kXOcQhx8crrH2XvhJ4=; b=6X9+proGSjC86mRyOf4tHttcso7OQLnn3VlBOHl0WD3qYOX3fV130J+XCf06Iu0p105SfyQTzn4sfixoCfjwgj5WwT0JPaS2HQazs73UeNWEWRedw5yGFjApYWLWUjhoWHov7j8dMEH+AQavojMvTy+ldG57WP4CzzrsMMIIG9Y= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from VI1PR08MB5325.eurprd08.prod.outlook.com (2603:10a6:803:13e::17) by AS8PR08MB6006.eurprd08.prod.outlook.com (2603:10a6:20b:29a::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.29; Mon, 27 Feb 2023 12:32:42 +0000 Received: from VI1PR08MB5325.eurprd08.prod.outlook.com ([fe80::210c:d369:23f7:84fe]) by VI1PR08MB5325.eurprd08.prod.outlook.com ([fe80::210c:d369:23f7:84fe%6]) with mapi id 15.20.6134.027; Mon, 27 Feb 2023 12:32:42 +0000 Date: Mon, 27 Feb 2023 12:32:39 +0000 From: Tamar Christina To: gcc-patches@gcc.gnu.org Cc: nd@arm.com, rguenther@suse.de, jlaw@ventanamicro.com Subject: [PATCH 1/4]middle-end: Revert can_special_div_by_const changes [PR108583] Message-ID: Content-Type: multipart/mixed; boundary="Bb1LqLjJrzIGR3e8" Content-Disposition: inline X-ClientProxiedBy: LO4P265CA0045.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:2ac::21) To VI1PR08MB5325.eurprd08.prod.outlook.com (2603:10a6:803:13e::17) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: VI1PR08MB5325:EE_|AS8PR08MB6006:EE_|AM7EUR03FT061:EE_|DB9PR08MB6620:EE_ X-MS-Office365-Filtering-Correlation-Id: c5dae077-86ca-4044-6ccb-08db18bebe7a x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: X27PnL+I1KWTeAEU/EnSoWIxs9obKxTyGxZf/0tHriE8OnhKUXRpg3/S6r8PRVz9tLHjK1Cgr7TdAZYyfctpX+IehnzPkYbllX5Bm8DHN1wEDLgTGA+Jg6D4BhzPprlK6YhgqOD6wMV6gMaeyVXN8TZOUGUeSc3jKMqNTsICMgTL0dAq7gTXPKtg9iG31RPDDpSkYVeTGbqAFCorZA4D9G72/MORd+qBvoo8/HpaYfknpoADPUADZgxmzaR0nIHuJd00sAzGMeft8zZtzc7E2TU2rFEfn7TCBUNOMKkQ4E8ZySoQ7uHMENjsnLDXuQLOfbf1hUm6yZLhf+izcAt/ym++cRutI331To6SR77sMQ3YWu1d9jrX7ipnivSeLkGX551j1UjjSiJnAMYoMlLDCGWv1qk5Ucn2VE9oXtjA6opc3Q6uFEwW3BwG8Kc4xW+i+DEQCRPC6YBNc80+VAsPMPVFjIxjXkAIYA5eMClUXj8jp8Kk45xNbX6Av4dG4P7yP1CG2Wq/X6dL0MORJob0CiSL9Pm5lRvORv7VkJKgvjhdWuSJq7ZQRTkzwI2AaCqV0kRwTPJbWhEkhoa6jUFa97o2lFn69VqjOYZwImkxudORhkOAftQWw/owMw+rWmdVMFPkTIkUtevEABBmUXDbbqcqwVC9vxeDfL9JHNqUxvIfw2RsJkQoJJEgdBHmzVygqiw8EDqZFEGAalEdyBRWKk7a3yN7OOMLIXlWlIYD69M= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR08MB5325.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(376002)(366004)(396003)(136003)(346002)(39850400004)(451199018)(316002)(2906002)(36756003)(5660300002)(235185007)(44832011)(30864003)(8936002)(86362001)(6512007)(33964004)(6506007)(44144004)(66946007)(8676002)(186003)(38100700002)(26005)(4743002)(4326008)(6916009)(66556008)(66476007)(41300700001)(2616005)(83380400001)(478600001)(6486002)(6666004)(4216001)(2700100001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6006 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT061.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 770e34fd-8e7c-4d0c-6364-08db18beb856 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0SpXn0nDPFTjZKT5FHJ+cM90YmOmSnskO+x4qayWCxmdYd8xIlwkHXwQJS6uiky1P7LOWQuttWB8qPwLa9841zKCLsjSGx/xbFWBAgChU2RUeQrBpKtbiIF3wh+EajQt6653Kk11gAfkOH/RZYrciwWfIBtaiqFHu4lzvXEyoQh2HDbx8V1mfC72TuYqj+UAdXBtrbDVJ8AWLzK/mgam0e34cc/1t/YgdLMX2dSs369d9ekIKEMHYvNwesxdzFVIY9QxigJ3RCruvWxlwjhChizn5ZaTgndZeF+y01BT2+ZJargJXgOReZBICJdoSfkrJMJ3sgCnZm6kAPYxN7KugbYLsJlWLAd77EPceG1AbZ7byR98ezbnLZ+bhQBe/I9zvE+szKtBQ1tYSawMLtD8yKPWyKULe6cy75KZf6pAfXLXlGSg04Nzjxpp1ZeFkCPlVxqfUf2XBeO1DiXOX+3Pf+vYyPRQF3vBXBeo+05/RW3Ah9NPcxyXEYL63VEnoR7/5LZHljUMBMCJ6v9F38U6GklZMfZTMNtTQf8TecceEZkqjfAEXO27uU+eQHZhYnRUC5OPvHPXfC3lChXdlMoU/42f908gZw6RAw5PLsXXGHWme8pCi9NGMDkh7gmlrV8L0jiCnLj2FcF3hAmhd1YjJLqtDvnhFmiCjGnrGSI7zoNbJiTw1CZxEpMhybfTrN2plOmyhS9AoRpftotxctKo1sTqGaQWLgzwmLqvoBS45OA= X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230025)(4636009)(136003)(346002)(376002)(39860400002)(396003)(451199018)(36840700001)(46966006)(81166007)(82740400003)(316002)(36860700001)(2906002)(36756003)(30864003)(5660300002)(235185007)(44832011)(8936002)(86362001)(40480700001)(6512007)(44144004)(33964004)(6506007)(70586007)(70206006)(26005)(4743002)(186003)(4326008)(6916009)(8676002)(356005)(41300700001)(336012)(2616005)(82310400005)(47076005)(478600001)(83380400001)(6486002)(107886003)(6666004)(4216001)(2700100001);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Feb 2023 12:32:52.0823 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c5dae077-86ca-4044-6ccb-08db18bebe7a 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: AM7EUR03FT061.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB6620 X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,FORGED_SPF_HELO,GIT_PATCH_0,KAM_DMARC_NONE,KAM_LOTSOFHASH,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,RCVD_IN_VALIDITY_RPBL,SPF_HELO_PASS,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 List-Id: --Bb1LqLjJrzIGR3e8 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Hi All, This reverts the changes for the CAN_SPECIAL_DIV_BY_CONST hook. Bootstrapped Regtested on aarch64-none-linux-gnu and no issues. Ok for master? Thanks, Tamar gcc/ChangeLog: PR target/108583 * doc/tm.texi (TARGET_VECTORIZE_CAN_SPECIAL_DIV_BY_CONST): Remove. * doc/tm.texi.in: Likewise. * explow.cc (round_push, align_dynamic_address): Revert previous patch. * expmed.cc (expand_divmod): Likewise. * expmed.h (expand_divmod): Likewise. * expr.cc (force_operand, expand_expr_divmod): Likewise. * optabs.cc (expand_doubleword_mod, expand_doubleword_divmod): Likewise. * target.def (can_special_div_by_const): Remove. * target.h: Remove tree-core.h include * targhooks.cc (default_can_special_div_by_const): Remove. * targhooks.h (default_can_special_div_by_const): Remove. * tree-vect-generic.cc (expand_vector_operation): Remove hook. * tree-vect-patterns.cc (vect_recog_divmod_pattern): Remove hook. * tree-vect-stmts.cc (vectorizable_operation): Remove hook. --- inline copy of patch -- diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index c6c891972d1e58cd163b259ba96a599d62326865..50a8872a6695b18b9bed0d393bacf733833633db 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -6137,20 +6137,6 @@ instruction pattern. There is no need for the hook to handle these two implementation approaches itself. @end deftypefn -@deftypefn {Target Hook} bool TARGET_VECTORIZE_CAN_SPECIAL_DIV_BY_CONST (enum @var{tree_code}, tree @var{vectype}, wide_int @var{constant}, rtx *@var{output}, rtx @var{in0}, rtx @var{in1}) -This hook is used to test whether the target has a special method of -division of vectors of type @var{vectype} using the value @var{constant}, -and producing a vector of type @var{vectype}. The division -will then not be decomposed by the vectorizer and kept as a div. - -When the hook is being used to test whether the target supports a special -divide, @var{in0}, @var{in1}, and @var{output} are all null. When the hook -is being used to emit a division, @var{in0} and @var{in1} are the source -vectors of type @var{vecttype} and @var{output} is the destination vector of -type @var{vectype}. - -Return true if the operation is possible, emitting instructions for it -if rtxes are provided and updating @var{output}. @end deftypefn @deftypefn {Target Hook} tree TARGET_VECTORIZE_BUILTIN_VECTORIZED_FUNCTION (unsigned @var{code}, tree @var{vec_type_out}, tree @var{vec_type_in}) diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in index 613b2534149415f442163d599503efaf423b673b..3e07978a02f4e6077adae6cadc93ea4273295f1f 100644 --- a/gcc/doc/tm.texi.in +++ b/gcc/doc/tm.texi.in @@ -4173,7 +4173,6 @@ address; but often a machine-dependent strategy can generate better code. @hook TARGET_VECTORIZE_VEC_PERM_CONST -@hook TARGET_VECTORIZE_CAN_SPECIAL_DIV_BY_CONST @hook TARGET_VECTORIZE_BUILTIN_VECTORIZED_FUNCTION diff --git a/gcc/explow.cc b/gcc/explow.cc index 83439b32abe1b9aa4b7983eb629804f97486acbd..be9195b33323ee5597fc212f0befa016eea4573c 100644 --- a/gcc/explow.cc +++ b/gcc/explow.cc @@ -1037,7 +1037,7 @@ round_push (rtx size) TRUNC_DIV_EXPR. */ size = expand_binop (Pmode, add_optab, size, alignm1_rtx, NULL_RTX, 1, OPTAB_LIB_WIDEN); - size = expand_divmod (0, TRUNC_DIV_EXPR, Pmode, NULL, NULL, size, align_rtx, + size = expand_divmod (0, TRUNC_DIV_EXPR, Pmode, size, align_rtx, NULL_RTX, 1); size = expand_mult (Pmode, size, align_rtx, NULL_RTX, 1); @@ -1203,7 +1203,7 @@ align_dynamic_address (rtx target, unsigned required_align) gen_int_mode (required_align / BITS_PER_UNIT - 1, Pmode), NULL_RTX, 1, OPTAB_LIB_WIDEN); - target = expand_divmod (0, TRUNC_DIV_EXPR, Pmode, NULL, NULL, target, + target = expand_divmod (0, TRUNC_DIV_EXPR, Pmode, target, gen_int_mode (required_align / BITS_PER_UNIT, Pmode), NULL_RTX, 1); diff --git a/gcc/expmed.h b/gcc/expmed.h index 0419e2dac85850889ce0bee59515e31a80c582de..4dfe635c22ee49f2dba4c53640941628068f3901 100644 --- a/gcc/expmed.h +++ b/gcc/expmed.h @@ -710,9 +710,8 @@ extern rtx expand_shift (enum tree_code, machine_mode, rtx, poly_int64, rtx, extern rtx maybe_expand_shift (enum tree_code, machine_mode, rtx, int, rtx, int); #ifdef GCC_OPTABS_H -extern rtx expand_divmod (int, enum tree_code, machine_mode, tree, tree, - rtx, rtx, rtx, int, - enum optab_methods = OPTAB_LIB_WIDEN); +extern rtx expand_divmod (int, enum tree_code, machine_mode, rtx, rtx, + rtx, int, enum optab_methods = OPTAB_LIB_WIDEN); #endif #endif diff --git a/gcc/expmed.cc b/gcc/expmed.cc index 917360199ca56157cf3c3693b65e93cd9d8ed244..1553ea8e31eb6433025ab18a3a59c169d3b7692f 100644 --- a/gcc/expmed.cc +++ b/gcc/expmed.cc @@ -4222,8 +4222,8 @@ expand_sdiv_pow2 (scalar_int_mode mode, rtx op0, HOST_WIDE_INT d) rtx expand_divmod (int rem_flag, enum tree_code code, machine_mode mode, - tree treeop0, tree treeop1, rtx op0, rtx op1, rtx target, - int unsignedp, enum optab_methods methods) + rtx op0, rtx op1, rtx target, int unsignedp, + enum optab_methods methods) { machine_mode compute_mode; rtx tquotient; @@ -4375,17 +4375,6 @@ expand_divmod (int rem_flag, enum tree_code code, machine_mode mode, last_div_const = ! rem_flag && op1_is_constant ? INTVAL (op1) : 0; - /* Check if the target has specific expansions for the division. */ - tree cst; - if (treeop0 - && treeop1 - && (cst = uniform_integer_cst_p (treeop1)) - && targetm.vectorize.can_special_div_by_const (code, TREE_TYPE (treeop0), - wi::to_wide (cst), - &target, op0, op1)) - return target; - - /* Now convert to the best mode to use. */ if (compute_mode != mode) { @@ -4629,8 +4618,8 @@ expand_divmod (int rem_flag, enum tree_code code, machine_mode mode, || (optab_handler (sdivmod_optab, int_mode) != CODE_FOR_nothing))) quotient = expand_divmod (0, TRUNC_DIV_EXPR, - int_mode, treeop0, treeop1, - op0, gen_int_mode (abs_d, + int_mode, op0, + gen_int_mode (abs_d, int_mode), NULL_RTX, 0); else @@ -4819,8 +4808,8 @@ expand_divmod (int rem_flag, enum tree_code code, machine_mode mode, size - 1, NULL_RTX, 0); t3 = force_operand (gen_rtx_MINUS (int_mode, t1, nsign), NULL_RTX); - t4 = expand_divmod (0, TRUNC_DIV_EXPR, int_mode, treeop0, - treeop1, t3, op1, NULL_RTX, 0); + t4 = expand_divmod (0, TRUNC_DIV_EXPR, int_mode, t3, op1, + NULL_RTX, 0); if (t4) { rtx t5; diff --git a/gcc/expr.cc b/gcc/expr.cc index 15be1c8db999103bb9e5fa33daa44ae06de5ace8..78d35297e755216339078d5b2280c6e277f26d72 100644 --- a/gcc/expr.cc +++ b/gcc/expr.cc @@ -8207,17 +8207,16 @@ force_operand (rtx value, rtx target) return expand_divmod (0, FLOAT_MODE_P (GET_MODE (value)) ? RDIV_EXPR : TRUNC_DIV_EXPR, - GET_MODE (value), NULL, NULL, op1, op2, - target, 0); + GET_MODE (value), op1, op2, target, 0); case MOD: - return expand_divmod (1, TRUNC_MOD_EXPR, GET_MODE (value), NULL, NULL, - op1, op2, target, 0); + return expand_divmod (1, TRUNC_MOD_EXPR, GET_MODE (value), op1, op2, + target, 0); case UDIV: - return expand_divmod (0, TRUNC_DIV_EXPR, GET_MODE (value), NULL, NULL, - op1, op2, target, 1); + return expand_divmod (0, TRUNC_DIV_EXPR, GET_MODE (value), op1, op2, + target, 1); case UMOD: - return expand_divmod (1, TRUNC_MOD_EXPR, GET_MODE (value), NULL, NULL, - op1, op2, target, 1); + return expand_divmod (1, TRUNC_MOD_EXPR, GET_MODE (value), op1, op2, + target, 1); case ASHIFTRT: return expand_simple_binop (GET_MODE (value), code, op1, op2, target, 0, OPTAB_LIB_WIDEN); @@ -9170,13 +9169,11 @@ expand_expr_divmod (tree_code code, machine_mode mode, tree treeop0, bool speed_p = optimize_insn_for_speed_p (); do_pending_stack_adjust (); start_sequence (); - rtx uns_ret = expand_divmod (mod_p, code, mode, treeop0, treeop1, - op0, op1, target, 1); + rtx uns_ret = expand_divmod (mod_p, code, mode, op0, op1, target, 1); rtx_insn *uns_insns = get_insns (); end_sequence (); start_sequence (); - rtx sgn_ret = expand_divmod (mod_p, code, mode, treeop0, treeop1, - op0, op1, target, 0); + rtx sgn_ret = expand_divmod (mod_p, code, mode, op0, op1, target, 0); rtx_insn *sgn_insns = get_insns (); end_sequence (); unsigned uns_cost = seq_cost (uns_insns, speed_p); @@ -9198,8 +9195,7 @@ expand_expr_divmod (tree_code code, machine_mode mode, tree treeop0, emit_insn (sgn_insns); return sgn_ret; } - return expand_divmod (mod_p, code, mode, treeop0, treeop1, - op0, op1, target, unsignedp); + return expand_divmod (mod_p, code, mode, op0, op1, target, unsignedp); } rtx diff --git a/gcc/optabs.cc b/gcc/optabs.cc index cf22bfec3f5513f56d22c866231edbf322ff6945..474ccbd7915b4f144cebe0369a6e77082c1e617b 100644 --- a/gcc/optabs.cc +++ b/gcc/optabs.cc @@ -1106,9 +1106,8 @@ expand_doubleword_mod (machine_mode mode, rtx op0, rtx op1, bool unsignedp) return NULL_RTX; } } - rtx remainder = expand_divmod (1, TRUNC_MOD_EXPR, word_mode, NULL, NULL, - sum, gen_int_mode (INTVAL (op1), - word_mode), + rtx remainder = expand_divmod (1, TRUNC_MOD_EXPR, word_mode, sum, + gen_int_mode (INTVAL (op1), word_mode), NULL_RTX, 1, OPTAB_DIRECT); if (remainder == NULL_RTX) return NULL_RTX; @@ -1211,8 +1210,8 @@ expand_doubleword_divmod (machine_mode mode, rtx op0, rtx op1, rtx *rem, if (op11 != const1_rtx) { - rtx rem2 = expand_divmod (1, TRUNC_MOD_EXPR, mode, NULL, NULL, quot1, - op11, NULL_RTX, unsignedp, OPTAB_DIRECT); + rtx rem2 = expand_divmod (1, TRUNC_MOD_EXPR, mode, quot1, op11, + NULL_RTX, unsignedp, OPTAB_DIRECT); if (rem2 == NULL_RTX) return NULL_RTX; @@ -1226,8 +1225,8 @@ expand_doubleword_divmod (machine_mode mode, rtx op0, rtx op1, rtx *rem, if (rem2 == NULL_RTX) return NULL_RTX; - rtx quot2 = expand_divmod (0, TRUNC_DIV_EXPR, mode, NULL, NULL, quot1, - op11, NULL_RTX, unsignedp, OPTAB_DIRECT); + rtx quot2 = expand_divmod (0, TRUNC_DIV_EXPR, mode, quot1, op11, + NULL_RTX, unsignedp, OPTAB_DIRECT); if (quot2 == NULL_RTX) return NULL_RTX; diff --git a/gcc/target.def b/gcc/target.def index db8af0cbe81624513f114fc9bbd8be61d855f409..e0a5c7adbd962f5d08ed08d1d81afa2c2baa64a5 100644 --- a/gcc/target.def +++ b/gcc/target.def @@ -1905,25 +1905,6 @@ implementation approaches itself.", const vec_perm_indices &sel), NULL) -DEFHOOK -(can_special_div_by_const, - "This hook is used to test whether the target has a special method of\n\ -division of vectors of type @var{vectype} using the value @var{constant},\n\ -and producing a vector of type @var{vectype}. The division\n\ -will then not be decomposed by the vectorizer and kept as a div.\n\ -\n\ -When the hook is being used to test whether the target supports a special\n\ -divide, @var{in0}, @var{in1}, and @var{output} are all null. When the hook\n\ -is being used to emit a division, @var{in0} and @var{in1} are the source\n\ -vectors of type @var{vecttype} and @var{output} is the destination vector of\n\ -type @var{vectype}.\n\ -\n\ -Return true if the operation is possible, emitting instructions for it\n\ -if rtxes are provided and updating @var{output}.", - bool, (enum tree_code, tree vectype, wide_int constant, rtx *output, - rtx in0, rtx in1), - default_can_special_div_by_const) - /* Return true if the target supports misaligned store/load of a specific factor denoted in the third parameter. The last parameter is true if the access is defined in a packed struct. */ diff --git a/gcc/target.h b/gcc/target.h index 03fd03a52075b4836159035ec14078c0aebdd7e9..93691882757232c514fca82b99f913158c2d47b1 100644 --- a/gcc/target.h +++ b/gcc/target.h @@ -51,7 +51,6 @@ #include "insn-codes.h" #include "tm.h" #include "hard-reg-set.h" -#include "tree-core.h" #if CHECKING_P diff --git a/gcc/targhooks.h b/gcc/targhooks.h index a1df260f5483dc84f18d8f12c5202484a32d5bb7..a6a4809ca91baa5d7fad2244549317a31390f0c2 100644 --- a/gcc/targhooks.h +++ b/gcc/targhooks.h @@ -209,8 +209,6 @@ extern void default_addr_space_diagnose_usage (addr_space_t, location_t); extern rtx default_addr_space_convert (rtx, tree, tree); extern unsigned int default_case_values_threshold (void); extern bool default_have_conditional_execution (void); -extern bool default_can_special_div_by_const (enum tree_code, tree, wide_int, - rtx *, rtx, rtx); extern bool default_libc_has_function (enum function_class, tree); extern bool default_libc_has_fast_function (int fcode); diff --git a/gcc/targhooks.cc b/gcc/targhooks.cc index fe0116521feaf32187e7bc113bf93b1805852c79..211525720a620d6f533e2da91e03877337a931e7 100644 --- a/gcc/targhooks.cc +++ b/gcc/targhooks.cc @@ -1840,14 +1840,6 @@ default_have_conditional_execution (void) return HAVE_conditional_execution; } -/* Default that no division by constant operations are special. */ -bool -default_can_special_div_by_const (enum tree_code, tree, wide_int, rtx *, rtx, - rtx) -{ - return false; -} - /* By default we assume that c99 functions are present at the runtime, but sincos is not. */ bool diff --git a/gcc/tree-vect-generic.cc b/gcc/tree-vect-generic.cc index 166a248f4b9512d4c6fc8d760b458b7a467f7790..519a824ec727d4d4f28c14077dc3e970bed75ef6 100644 --- a/gcc/tree-vect-generic.cc +++ b/gcc/tree-vect-generic.cc @@ -1237,17 +1237,6 @@ expand_vector_operation (gimple_stmt_iterator *gsi, tree type, tree compute_type tree rhs2 = gimple_assign_rhs2 (assign); tree ret; - /* Check if the target was going to handle it through the special - division callback hook. */ - tree cst = uniform_integer_cst_p (rhs2); - if (cst && - targetm.vectorize.can_special_div_by_const (code, type, - wi::to_wide (cst), - NULL, - NULL_RTX, NULL_RTX)) - return NULL_TREE; - - if (!optimize || !VECTOR_INTEGER_TYPE_P (type) || TREE_CODE (rhs2) != VECTOR_CST diff --git a/gcc/tree-vect-patterns.cc b/gcc/tree-vect-patterns.cc index 6934aebc69f231af24668f0a1c3d140e97f55487..1766ce277d6b88d8aa3be77e7c8abb504a10a735 100644 --- a/gcc/tree-vect-patterns.cc +++ b/gcc/tree-vect-patterns.cc @@ -3913,14 +3913,6 @@ vect_recog_divmod_pattern (vec_info *vinfo, return pattern_stmt; } - else if ((cst = uniform_integer_cst_p (oprnd1)) - && targetm.vectorize.can_special_div_by_const (rhs_code, vectype, - wi::to_wide (cst), - NULL, NULL_RTX, - NULL_RTX)) - { - return NULL; - } if (prec > HOST_BITS_PER_WIDE_INT || integer_zerop (oprnd1)) diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc index eb4ca1f184e374d177eb43d5eb93acf6e6a8fde9..3a0fb5ad898ad42c3867f0b9564fc4e066e50081 100644 --- a/gcc/tree-vect-stmts.cc +++ b/gcc/tree-vect-stmts.cc @@ -6263,15 +6263,6 @@ vectorizable_operation (vec_info *vinfo, } target_support_p = (optab_handler (optab, vec_mode) != CODE_FOR_nothing); - tree cst; - if (!target_support_p - && op1 - && (cst = uniform_integer_cst_p (op1))) - target_support_p - = targetm.vectorize.can_special_div_by_const (code, vectype, - wi::to_wide (cst), - NULL, NULL_RTX, - NULL_RTX); } bool using_emulated_vectors_p = vect_emulated_vector_p (vectype); -- --Bb1LqLjJrzIGR3e8 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="rb16928.patch" diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index c6c891972d1e58cd163b259ba96a599d62326865..50a8872a6695b18b9bed0d393bacf733833633db 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -6137,20 +6137,6 @@ instruction pattern. There is no need for the hook to handle these two implementation approaches itself. @end deftypefn -@deftypefn {Target Hook} bool TARGET_VECTORIZE_CAN_SPECIAL_DIV_BY_CONST (enum @var{tree_code}, tree @var{vectype}, wide_int @var{constant}, rtx *@var{output}, rtx @var{in0}, rtx @var{in1}) -This hook is used to test whether the target has a special method of -division of vectors of type @var{vectype} using the value @var{constant}, -and producing a vector of type @var{vectype}. The division -will then not be decomposed by the vectorizer and kept as a div. - -When the hook is being used to test whether the target supports a special -divide, @var{in0}, @var{in1}, and @var{output} are all null. When the hook -is being used to emit a division, @var{in0} and @var{in1} are the source -vectors of type @var{vecttype} and @var{output} is the destination vector of -type @var{vectype}. - -Return true if the operation is possible, emitting instructions for it -if rtxes are provided and updating @var{output}. @end deftypefn @deftypefn {Target Hook} tree TARGET_VECTORIZE_BUILTIN_VECTORIZED_FUNCTION (unsigned @var{code}, tree @var{vec_type_out}, tree @var{vec_type_in}) diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in index 613b2534149415f442163d599503efaf423b673b..3e07978a02f4e6077adae6cadc93ea4273295f1f 100644 --- a/gcc/doc/tm.texi.in +++ b/gcc/doc/tm.texi.in @@ -4173,7 +4173,6 @@ address; but often a machine-dependent strategy can generate better code. @hook TARGET_VECTORIZE_VEC_PERM_CONST -@hook TARGET_VECTORIZE_CAN_SPECIAL_DIV_BY_CONST @hook TARGET_VECTORIZE_BUILTIN_VECTORIZED_FUNCTION diff --git a/gcc/explow.cc b/gcc/explow.cc index 83439b32abe1b9aa4b7983eb629804f97486acbd..be9195b33323ee5597fc212f0befa016eea4573c 100644 --- a/gcc/explow.cc +++ b/gcc/explow.cc @@ -1037,7 +1037,7 @@ round_push (rtx size) TRUNC_DIV_EXPR. */ size = expand_binop (Pmode, add_optab, size, alignm1_rtx, NULL_RTX, 1, OPTAB_LIB_WIDEN); - size = expand_divmod (0, TRUNC_DIV_EXPR, Pmode, NULL, NULL, size, align_rtx, + size = expand_divmod (0, TRUNC_DIV_EXPR, Pmode, size, align_rtx, NULL_RTX, 1); size = expand_mult (Pmode, size, align_rtx, NULL_RTX, 1); @@ -1203,7 +1203,7 @@ align_dynamic_address (rtx target, unsigned required_align) gen_int_mode (required_align / BITS_PER_UNIT - 1, Pmode), NULL_RTX, 1, OPTAB_LIB_WIDEN); - target = expand_divmod (0, TRUNC_DIV_EXPR, Pmode, NULL, NULL, target, + target = expand_divmod (0, TRUNC_DIV_EXPR, Pmode, target, gen_int_mode (required_align / BITS_PER_UNIT, Pmode), NULL_RTX, 1); diff --git a/gcc/expmed.h b/gcc/expmed.h index 0419e2dac85850889ce0bee59515e31a80c582de..4dfe635c22ee49f2dba4c53640941628068f3901 100644 --- a/gcc/expmed.h +++ b/gcc/expmed.h @@ -710,9 +710,8 @@ extern rtx expand_shift (enum tree_code, machine_mode, rtx, poly_int64, rtx, extern rtx maybe_expand_shift (enum tree_code, machine_mode, rtx, int, rtx, int); #ifdef GCC_OPTABS_H -extern rtx expand_divmod (int, enum tree_code, machine_mode, tree, tree, - rtx, rtx, rtx, int, - enum optab_methods = OPTAB_LIB_WIDEN); +extern rtx expand_divmod (int, enum tree_code, machine_mode, rtx, rtx, + rtx, int, enum optab_methods = OPTAB_LIB_WIDEN); #endif #endif diff --git a/gcc/expmed.cc b/gcc/expmed.cc index 917360199ca56157cf3c3693b65e93cd9d8ed244..1553ea8e31eb6433025ab18a3a59c169d3b7692f 100644 --- a/gcc/expmed.cc +++ b/gcc/expmed.cc @@ -4222,8 +4222,8 @@ expand_sdiv_pow2 (scalar_int_mode mode, rtx op0, HOST_WIDE_INT d) rtx expand_divmod (int rem_flag, enum tree_code code, machine_mode mode, - tree treeop0, tree treeop1, rtx op0, rtx op1, rtx target, - int unsignedp, enum optab_methods methods) + rtx op0, rtx op1, rtx target, int unsignedp, + enum optab_methods methods) { machine_mode compute_mode; rtx tquotient; @@ -4375,17 +4375,6 @@ expand_divmod (int rem_flag, enum tree_code code, machine_mode mode, last_div_const = ! rem_flag && op1_is_constant ? INTVAL (op1) : 0; - /* Check if the target has specific expansions for the division. */ - tree cst; - if (treeop0 - && treeop1 - && (cst = uniform_integer_cst_p (treeop1)) - && targetm.vectorize.can_special_div_by_const (code, TREE_TYPE (treeop0), - wi::to_wide (cst), - &target, op0, op1)) - return target; - - /* Now convert to the best mode to use. */ if (compute_mode != mode) { @@ -4629,8 +4618,8 @@ expand_divmod (int rem_flag, enum tree_code code, machine_mode mode, || (optab_handler (sdivmod_optab, int_mode) != CODE_FOR_nothing))) quotient = expand_divmod (0, TRUNC_DIV_EXPR, - int_mode, treeop0, treeop1, - op0, gen_int_mode (abs_d, + int_mode, op0, + gen_int_mode (abs_d, int_mode), NULL_RTX, 0); else @@ -4819,8 +4808,8 @@ expand_divmod (int rem_flag, enum tree_code code, machine_mode mode, size - 1, NULL_RTX, 0); t3 = force_operand (gen_rtx_MINUS (int_mode, t1, nsign), NULL_RTX); - t4 = expand_divmod (0, TRUNC_DIV_EXPR, int_mode, treeop0, - treeop1, t3, op1, NULL_RTX, 0); + t4 = expand_divmod (0, TRUNC_DIV_EXPR, int_mode, t3, op1, + NULL_RTX, 0); if (t4) { rtx t5; diff --git a/gcc/expr.cc b/gcc/expr.cc index 15be1c8db999103bb9e5fa33daa44ae06de5ace8..78d35297e755216339078d5b2280c6e277f26d72 100644 --- a/gcc/expr.cc +++ b/gcc/expr.cc @@ -8207,17 +8207,16 @@ force_operand (rtx value, rtx target) return expand_divmod (0, FLOAT_MODE_P (GET_MODE (value)) ? RDIV_EXPR : TRUNC_DIV_EXPR, - GET_MODE (value), NULL, NULL, op1, op2, - target, 0); + GET_MODE (value), op1, op2, target, 0); case MOD: - return expand_divmod (1, TRUNC_MOD_EXPR, GET_MODE (value), NULL, NULL, - op1, op2, target, 0); + return expand_divmod (1, TRUNC_MOD_EXPR, GET_MODE (value), op1, op2, + target, 0); case UDIV: - return expand_divmod (0, TRUNC_DIV_EXPR, GET_MODE (value), NULL, NULL, - op1, op2, target, 1); + return expand_divmod (0, TRUNC_DIV_EXPR, GET_MODE (value), op1, op2, + target, 1); case UMOD: - return expand_divmod (1, TRUNC_MOD_EXPR, GET_MODE (value), NULL, NULL, - op1, op2, target, 1); + return expand_divmod (1, TRUNC_MOD_EXPR, GET_MODE (value), op1, op2, + target, 1); case ASHIFTRT: return expand_simple_binop (GET_MODE (value), code, op1, op2, target, 0, OPTAB_LIB_WIDEN); @@ -9170,13 +9169,11 @@ expand_expr_divmod (tree_code code, machine_mode mode, tree treeop0, bool speed_p = optimize_insn_for_speed_p (); do_pending_stack_adjust (); start_sequence (); - rtx uns_ret = expand_divmod (mod_p, code, mode, treeop0, treeop1, - op0, op1, target, 1); + rtx uns_ret = expand_divmod (mod_p, code, mode, op0, op1, target, 1); rtx_insn *uns_insns = get_insns (); end_sequence (); start_sequence (); - rtx sgn_ret = expand_divmod (mod_p, code, mode, treeop0, treeop1, - op0, op1, target, 0); + rtx sgn_ret = expand_divmod (mod_p, code, mode, op0, op1, target, 0); rtx_insn *sgn_insns = get_insns (); end_sequence (); unsigned uns_cost = seq_cost (uns_insns, speed_p); @@ -9198,8 +9195,7 @@ expand_expr_divmod (tree_code code, machine_mode mode, tree treeop0, emit_insn (sgn_insns); return sgn_ret; } - return expand_divmod (mod_p, code, mode, treeop0, treeop1, - op0, op1, target, unsignedp); + return expand_divmod (mod_p, code, mode, op0, op1, target, unsignedp); } rtx diff --git a/gcc/optabs.cc b/gcc/optabs.cc index cf22bfec3f5513f56d22c866231edbf322ff6945..474ccbd7915b4f144cebe0369a6e77082c1e617b 100644 --- a/gcc/optabs.cc +++ b/gcc/optabs.cc @@ -1106,9 +1106,8 @@ expand_doubleword_mod (machine_mode mode, rtx op0, rtx op1, bool unsignedp) return NULL_RTX; } } - rtx remainder = expand_divmod (1, TRUNC_MOD_EXPR, word_mode, NULL, NULL, - sum, gen_int_mode (INTVAL (op1), - word_mode), + rtx remainder = expand_divmod (1, TRUNC_MOD_EXPR, word_mode, sum, + gen_int_mode (INTVAL (op1), word_mode), NULL_RTX, 1, OPTAB_DIRECT); if (remainder == NULL_RTX) return NULL_RTX; @@ -1211,8 +1210,8 @@ expand_doubleword_divmod (machine_mode mode, rtx op0, rtx op1, rtx *rem, if (op11 != const1_rtx) { - rtx rem2 = expand_divmod (1, TRUNC_MOD_EXPR, mode, NULL, NULL, quot1, - op11, NULL_RTX, unsignedp, OPTAB_DIRECT); + rtx rem2 = expand_divmod (1, TRUNC_MOD_EXPR, mode, quot1, op11, + NULL_RTX, unsignedp, OPTAB_DIRECT); if (rem2 == NULL_RTX) return NULL_RTX; @@ -1226,8 +1225,8 @@ expand_doubleword_divmod (machine_mode mode, rtx op0, rtx op1, rtx *rem, if (rem2 == NULL_RTX) return NULL_RTX; - rtx quot2 = expand_divmod (0, TRUNC_DIV_EXPR, mode, NULL, NULL, quot1, - op11, NULL_RTX, unsignedp, OPTAB_DIRECT); + rtx quot2 = expand_divmod (0, TRUNC_DIV_EXPR, mode, quot1, op11, + NULL_RTX, unsignedp, OPTAB_DIRECT); if (quot2 == NULL_RTX) return NULL_RTX; diff --git a/gcc/target.def b/gcc/target.def index db8af0cbe81624513f114fc9bbd8be61d855f409..e0a5c7adbd962f5d08ed08d1d81afa2c2baa64a5 100644 --- a/gcc/target.def +++ b/gcc/target.def @@ -1905,25 +1905,6 @@ implementation approaches itself.", const vec_perm_indices &sel), NULL) -DEFHOOK -(can_special_div_by_const, - "This hook is used to test whether the target has a special method of\n\ -division of vectors of type @var{vectype} using the value @var{constant},\n\ -and producing a vector of type @var{vectype}. The division\n\ -will then not be decomposed by the vectorizer and kept as a div.\n\ -\n\ -When the hook is being used to test whether the target supports a special\n\ -divide, @var{in0}, @var{in1}, and @var{output} are all null. When the hook\n\ -is being used to emit a division, @var{in0} and @var{in1} are the source\n\ -vectors of type @var{vecttype} and @var{output} is the destination vector of\n\ -type @var{vectype}.\n\ -\n\ -Return true if the operation is possible, emitting instructions for it\n\ -if rtxes are provided and updating @var{output}.", - bool, (enum tree_code, tree vectype, wide_int constant, rtx *output, - rtx in0, rtx in1), - default_can_special_div_by_const) - /* Return true if the target supports misaligned store/load of a specific factor denoted in the third parameter. The last parameter is true if the access is defined in a packed struct. */ diff --git a/gcc/target.h b/gcc/target.h index 03fd03a52075b4836159035ec14078c0aebdd7e9..93691882757232c514fca82b99f913158c2d47b1 100644 --- a/gcc/target.h +++ b/gcc/target.h @@ -51,7 +51,6 @@ #include "insn-codes.h" #include "tm.h" #include "hard-reg-set.h" -#include "tree-core.h" #if CHECKING_P diff --git a/gcc/targhooks.h b/gcc/targhooks.h index a1df260f5483dc84f18d8f12c5202484a32d5bb7..a6a4809ca91baa5d7fad2244549317a31390f0c2 100644 --- a/gcc/targhooks.h +++ b/gcc/targhooks.h @@ -209,8 +209,6 @@ extern void default_addr_space_diagnose_usage (addr_space_t, location_t); extern rtx default_addr_space_convert (rtx, tree, tree); extern unsigned int default_case_values_threshold (void); extern bool default_have_conditional_execution (void); -extern bool default_can_special_div_by_const (enum tree_code, tree, wide_int, - rtx *, rtx, rtx); extern bool default_libc_has_function (enum function_class, tree); extern bool default_libc_has_fast_function (int fcode); diff --git a/gcc/targhooks.cc b/gcc/targhooks.cc index fe0116521feaf32187e7bc113bf93b1805852c79..211525720a620d6f533e2da91e03877337a931e7 100644 --- a/gcc/targhooks.cc +++ b/gcc/targhooks.cc @@ -1840,14 +1840,6 @@ default_have_conditional_execution (void) return HAVE_conditional_execution; } -/* Default that no division by constant operations are special. */ -bool -default_can_special_div_by_const (enum tree_code, tree, wide_int, rtx *, rtx, - rtx) -{ - return false; -} - /* By default we assume that c99 functions are present at the runtime, but sincos is not. */ bool diff --git a/gcc/tree-vect-generic.cc b/gcc/tree-vect-generic.cc index 166a248f4b9512d4c6fc8d760b458b7a467f7790..519a824ec727d4d4f28c14077dc3e970bed75ef6 100644 --- a/gcc/tree-vect-generic.cc +++ b/gcc/tree-vect-generic.cc @@ -1237,17 +1237,6 @@ expand_vector_operation (gimple_stmt_iterator *gsi, tree type, tree compute_type tree rhs2 = gimple_assign_rhs2 (assign); tree ret; - /* Check if the target was going to handle it through the special - division callback hook. */ - tree cst = uniform_integer_cst_p (rhs2); - if (cst && - targetm.vectorize.can_special_div_by_const (code, type, - wi::to_wide (cst), - NULL, - NULL_RTX, NULL_RTX)) - return NULL_TREE; - - if (!optimize || !VECTOR_INTEGER_TYPE_P (type) || TREE_CODE (rhs2) != VECTOR_CST diff --git a/gcc/tree-vect-patterns.cc b/gcc/tree-vect-patterns.cc index 6934aebc69f231af24668f0a1c3d140e97f55487..1766ce277d6b88d8aa3be77e7c8abb504a10a735 100644 --- a/gcc/tree-vect-patterns.cc +++ b/gcc/tree-vect-patterns.cc @@ -3913,14 +3913,6 @@ vect_recog_divmod_pattern (vec_info *vinfo, return pattern_stmt; } - else if ((cst = uniform_integer_cst_p (oprnd1)) - && targetm.vectorize.can_special_div_by_const (rhs_code, vectype, - wi::to_wide (cst), - NULL, NULL_RTX, - NULL_RTX)) - { - return NULL; - } if (prec > HOST_BITS_PER_WIDE_INT || integer_zerop (oprnd1)) diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc index eb4ca1f184e374d177eb43d5eb93acf6e6a8fde9..3a0fb5ad898ad42c3867f0b9564fc4e066e50081 100644 --- a/gcc/tree-vect-stmts.cc +++ b/gcc/tree-vect-stmts.cc @@ -6263,15 +6263,6 @@ vectorizable_operation (vec_info *vinfo, } target_support_p = (optab_handler (optab, vec_mode) != CODE_FOR_nothing); - tree cst; - if (!target_support_p - && op1 - && (cst = uniform_integer_cst_p (op1))) - target_support_p - = targetm.vectorize.can_special_div_by_const (code, vectype, - wi::to_wide (cst), - NULL, NULL_RTX, - NULL_RTX); } bool using_emulated_vectors_p = vect_emulated_vector_p (vectype); --Bb1LqLjJrzIGR3e8--