From patchwork Mon Oct 28 11:42:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Law X-Patchwork-Id: 2003227 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=VsaHdreT; 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 4XcWj44X1Mz1xwF for ; Mon, 28 Oct 2024 22:42:48 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D27DE3858D26 for ; Mon, 28 Oct 2024 11:42:46 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) by sourceware.org (Postfix) with ESMTPS id C00EE3858C48 for ; Mon, 28 Oct 2024 11:42:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C00EE3858C48 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C00EE3858C48 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::42f ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1730115745; cv=none; b=pb8No1gaxzbN0nqqquroyzbnc8Q+FIgAU2JZzlewgNPeWIheIqm1xM250WwwS8FNZ5bBPZXoIXflFq4RjAclMK1gIlRvuF1c09MQrnUS93XUPCPUEfzJVb3dnEYofsLTpcafV43LJcWVklEPXZk722KVAN54MW8LKzHMNwo3kcQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1730115745; c=relaxed/simple; bh=sGOP5EPKmhf165ae1Gw1Pf3aVvmCYt79hzVJL8USWYY=; h=DKIM-Signature:Message-ID:Date:MIME-Version:From:Subject:To; b=DRlp67xCLDQn9SWAvLGM/BriCXwgaRqE3agbuhfKil8PJOerogecXC9yLM6yMNWHrcAlNPIGxuAyfVMf8WHhAjJrDS6Os18AozDDDBUb6V0u7IS1XY2WNsECwoXGT48B820CYT4thXkocqcYO0bo60oxyKZdcFbwYslI1Z8DwGM= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-71e6cec7227so3426328b3a.0 for ; Mon, 28 Oct 2024 04:42:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730115740; x=1730720540; darn=gcc.gnu.org; h=to:subject:from:content-language:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=1bMT1kM3zbTLYlwmCX+fVpMC0QUNlWGfCvcaiOjC/MQ=; b=VsaHdreTV6wAQv8Sm+FSjLwCvp5Ury3x8iQqCLfi6akidRf1QNgMc4nutJVDjAXAyo unkL+3M7Cwfkp82uncMFPyjmuc3cqHwQuFRpzL6VqCS3Wa1XlxZagNljAQkWmH8brIz2 Mjsy0HziJI4UO9STkiz6WvZ4+/ezNbcdMfTGNHN5YijstAm8Vjb4q0zMfbCgWyopEFZJ bHOr9xe0ZiVduFhHBOKkXShFjQOH9Ov+qs66IYiLSPtvGEGh7sXy2e3lY1UpSaoOtpOD nr3UmP8snEbRrUp4LeJHy0/DwMnN10fVpK3tizQAGas9dWOr9aTCFGQICmuDdTSTn+pM rWAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730115740; x=1730720540; h=to:subject:from:content-language:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=1bMT1kM3zbTLYlwmCX+fVpMC0QUNlWGfCvcaiOjC/MQ=; b=QTpy9P4KkSCSf6ojP942/MEp2XlX73/NkcS00VSZ5K+XiDcI2FOuOCalm894k1LmAB M/0XTiwjvhKjz/SaDLL7qM8idHuxvPGE2evl91rRAbR/ThCIlm+X1BL3bVMohBC9uN2y FbLyx0C6xGf1ns4QnECwT2nHGtPOKTRyVl+ybFtULZmRCSj0Neq4AdWfydxuPz77rBC8 OmMcxTfRC8ojg51ANFMtFsji2P7ELcFAnwf45FMUY6MtxQIJrHOeFSta3mK75IU6YPH8 Ul3HhFb34BNetYiO7ZpPWS2hRK/668x8iDkRkqc09Hl/geTh4ABcn+XUsjsZbT2pxjzB avBA== X-Gm-Message-State: AOJu0YzXn6SOjBZkLxMPTBzEIXdHrPi2leNWJRaGKPW2KyDd/TRsM09p WPnrNZd3No1oKneDkZvOn5Sb6x3W9LugXchTAQJa0Qrv2/Gs98LBxwqSlg== X-Google-Smtp-Source: AGHT+IHenepiBauw3a1oWfVDfRl/i2H0gLaY+D/uMiTilsO+TBqWhnAOQSlB1+L3z0xlSujEmrqdtw== X-Received: by 2002:a05:6a21:38d:b0:1d8:b11e:19b9 with SMTP id adf61e73a8af0-1d9a850aaecmr11391942637.47.1730115740406; Mon, 28 Oct 2024 04:42:20 -0700 (PDT) Received: from [172.31.0.109] ([136.36.72.243]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7edc867d122sm5559692a12.27.2024.10.28.04.42.19 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 28 Oct 2024 04:42:19 -0700 (PDT) Message-ID: <91dc038e-df7b-4455-b0b9-6cecfbff82b7@gmail.com> Date: Mon, 28 Oct 2024 05:42:18 -0600 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US From: Jeff Law Subject: [committed][target/117316] Fix initializer for riscv code alignment handling To: "gcc-patches@gcc.gnu.org" X-Spam-Status: No, score=-8.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP 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 The construct used for initializing the code alignments in a recent change is causing bootstrap problems on riscv64 as seen in the referenced bugzilla. This patch adjusts the initializer by pushing the NULL down into each uarch clause. Bootstrapped on riscv64, regression test in flight, but given bootstrap is broken it seemed advisable to move this forward now. I'm so much looking forward to the day when we have performant hardware for bootstrap testing... Sigh. Anyway, bootstrapped and installing on the trunk. Jeff commit f475a31ab4c7f27f6f8c7a418412f9fddc371638 Author: Jeff Law Date: Mon Oct 28 05:39:24 2024 -0600 [target/117316] Fix initializer for riscv code alignment handling The construct used for initializing the code alignments in a recent change is causing bootstrap problems on riscv64 as seen in the referenced bugzilla. This patch adjusts the initializer by pushing the NULL down into each uarch clause. Bootstrapped on riscv64, regression test in flight, but given bootstrap is broken it seemed advisable to move this forward now. I'm so much looking forward to the day when we have performant hardware for bootstrap testing... Sigh. Anyway, bootstrapped and installing on the trunk. PR target/117316 gcc/ * config/riscv/riscv.cc (riscv_tune_param): Drop initializer. (*_tune_info): Add initializers for code alignments. diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc index 7d6fc1429b5..be7c29f274d 100644 --- a/gcc/config/riscv/riscv.cc +++ b/gcc/config/riscv/riscv.cc @@ -295,9 +295,9 @@ struct riscv_tune_param bool overlap_op_by_pieces; unsigned int fusible_ops; const struct cpu_vector_cost *vec_costs; - const char *function_align = nullptr; - const char *jump_align = nullptr; - const char *loop_align = nullptr; + const char *function_align; + const char *jump_align; + const char *loop_align; }; @@ -457,6 +457,9 @@ static const struct riscv_tune_param rocket_tune_info = { false, /* overlap_op_by_pieces */ RISCV_FUSE_NOTHING, /* fusible_ops */ NULL, /* vector cost */ + NULL, /* function_align */ + NULL, /* jump_align */ + NULL, /* loop_align */ }; /* Costs to use when optimizing for Sifive 7 Series. */ @@ -476,6 +479,9 @@ static const struct riscv_tune_param sifive_7_tune_info = { false, /* overlap_op_by_pieces */ RISCV_FUSE_NOTHING, /* fusible_ops */ NULL, /* vector cost */ + NULL, /* function_align */ + NULL, /* jump_align */ + NULL, /* loop_align */ }; /* Costs to use when optimizing for Sifive p400 Series. */ @@ -495,6 +501,9 @@ static const struct riscv_tune_param sifive_p400_tune_info = { false, /* overlap_op_by_pieces */ RISCV_FUSE_LUI_ADDI | RISCV_FUSE_AUIPC_ADDI, /* fusible_ops */ &generic_vector_cost, /* vector cost */ + NULL, /* function_align */ + NULL, /* jump_align */ + NULL, /* loop_align */ }; /* Costs to use when optimizing for Sifive p600 Series. */ @@ -514,6 +523,9 @@ static const struct riscv_tune_param sifive_p600_tune_info = { false, /* overlap_op_by_pieces */ RISCV_FUSE_LUI_ADDI | RISCV_FUSE_AUIPC_ADDI, /* fusible_ops */ &generic_vector_cost, /* vector cost */ + NULL, /* function_align */ + NULL, /* jump_align */ + NULL, /* loop_align */ }; /* Costs to use when optimizing for T-HEAD c906. */ @@ -533,6 +545,9 @@ static const struct riscv_tune_param thead_c906_tune_info = { false, /* overlap_op_by_pieces */ RISCV_FUSE_NOTHING, /* fusible_ops */ NULL, /* vector cost */ + NULL, /* function_align */ + NULL, /* jump_align */ + NULL, /* loop_align */ }; /* Costs to use when optimizing for xiangshan nanhu. */ @@ -552,6 +567,9 @@ static const struct riscv_tune_param xiangshan_nanhu_tune_info = { false, /* overlap_op_by_pieces */ RISCV_FUSE_ZEXTW | RISCV_FUSE_ZEXTH, /* fusible_ops */ NULL, /* vector cost */ + NULL, /* function_align */ + NULL, /* jump_align */ + NULL, /* loop_align */ }; /* Costs to use when optimizing for a generic ooo profile. */ @@ -571,6 +589,9 @@ static const struct riscv_tune_param generic_ooo_tune_info = { true, /* overlap_op_by_pieces */ RISCV_FUSE_NOTHING, /* fusible_ops */ &generic_vector_cost, /* vector cost */ + NULL, /* function_align */ + NULL, /* jump_align */ + NULL, /* loop_align */ }; /* Costs to use when optimizing for size. */ @@ -590,6 +611,9 @@ static const struct riscv_tune_param optimize_size_tune_info = { false, /* overlap_op_by_pieces */ RISCV_FUSE_NOTHING, /* fusible_ops */ NULL, /* vector cost */ + NULL, /* function_align */ + NULL, /* jump_align */ + NULL, /* loop_align */ }; static bool riscv_avoid_shrink_wrapping_separate ();