From patchwork Mon Jan 29 10:34:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tobias Burnus X-Patchwork-Id: 1892165 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=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=1YF3rjRV; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; 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 [8.43.85.97]) (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 4TNl6J5bq0z1yQ0 for ; Mon, 29 Jan 2024 21:34:32 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 837E53858C2D for ; Mon, 29 Jan 2024 10:34:30 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by sourceware.org (Postfix) with ESMTPS id 517BC3858D20 for ; Mon, 29 Jan 2024 10:34:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 517BC3858D20 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=baylibre.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 517BC3858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::430 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706524450; cv=none; b=clyYlYH0XMyz9RdMj1csQAFWUkUmc4GBMw0XFVGsJbP/EqwXa9RabIgPRKfHHJdwJFHaKCQ9szv3V5nURrkNLTnwkm7kZ3lXigrPFO49pnRHGHkw1o7zUAWbWiXSa+BiYZz72mj93xU6ZMaJb75TExZLNyinrDsOlLqxJrzfrP8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706524450; c=relaxed/simple; bh=TZnPVF8CpA92jZuMeIzeivQu5ic6dpQH8aJuIDN//6o=; h=DKIM-Signature:Message-ID:Date:MIME-Version:To:From:Subject; b=QfveM4R+ftTgTvlSQnnX7rZc1ssBY0K4EXjNEJXsh4Bg4S4eK72xFxsKuOFMYpA+RCENVA3rmb/2G+MVdcJUgRBi5t/yfX9KQQWb3Kj98z/L/AedYrnmvGzUq8hIyI3FiipYeCtpyN7pnegdrMBSqLZEny6pdb9sLwfiTB2JzJI= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-33ae3be1c37so764824f8f.0 for ; Mon, 29 Jan 2024 02:34:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1706524447; x=1707129247; darn=gcc.gnu.org; h=cc:subject:from:to:content-language:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=OQhOxXMNI0pBlKr6v2gEpHTlAienjzLtOnzx8p26VZw=; b=1YF3rjRVVUDt6adNNEnRBmNMdCCbyqVuoLCqHH7hfzkv9eUpeBZAOXGqaUYvnMvIVh kklqhISz3mCnEYztbouMW5CvIPbu8THXguohE8+3Ze3tqsWVuhECmwb4S+sNKnbBbxDx dSB3vmlym7ifIZBCHf8LPNLRzIcH9fXmwk5+5r0Jicg4UXvP0FOVTgShFTQp59V5T+Np jFT+D2meinOGSDtSsR/GIaKPY6nw8mMFaOvOJmcX4T0Nd0tVEPsVNwL8yE2lyMujupZR 19JuekAn7xPRRg2L1h5d1zd/SaR1QbYKAvf21NJh598fVCtSDWhcxQHiVs6IHktZTwAx 4uHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706524447; x=1707129247; h=cc:subject:from:to:content-language:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=OQhOxXMNI0pBlKr6v2gEpHTlAienjzLtOnzx8p26VZw=; b=A+tlrGSOpKotKkrlOR4uyOAi0xZW6ZuoZNFuyuGnpvnzJP+551JSiVjHt+6ryWS9le nPNOMsL2sYymfzwVF8VU1SAALsG4Nhgws+efZSIe1zC26HR31JeCVTLX56N/SA9Lum60 SRnH/EgqXaIrTPhXqUJsBOxIkF8cpWXs15nkcWvhcIDov+0y/QYrzh6VMgTXtP6yKAGK ecTfNgm2GVJsIU5zeQNJ7V48iUxynHVSWaz4dM3Xkod889RSaF79hVlEA/gGhnS3dFFG ghA8gila30NnaboARoHGRYvjL31pgG/Jm5o/jEvj7EojVHQslBFCaEdHc1P5RsEyqMMc RKug== X-Gm-Message-State: AOJu0Yxis2JVW0WQ2Z1ktSwLhMFkmC27PGGJ7eOI2UFFZRHJmVoO9itT AeYPJRvLq4tIj5k8skvlxlwaZIGRmT1hhq7f+Nb3oPOBD95u0nduVisRH+/0snp0tIruONLGuLM e X-Google-Smtp-Source: AGHT+IEQER9N0uJcM7QGj2gk9jFur6D87puBGsxNurkMqWpJnvRpC5msrBc7wzDyX/zNVLt2Mr8U1g== X-Received: by 2002:a5d:4651:0:b0:336:8d35:f7e9 with SMTP id j17-20020a5d4651000000b003368d35f7e9mr3510241wrs.22.1706524447065; Mon, 29 Jan 2024 02:34:07 -0800 (PST) Received: from ?IPV6:2001:16b8:2a2e:4200:be03:58ff:fe31:f74? (200116b82a2e4200be0358fffe310f74.dip.versatel-1u1.de. [2001:16b8:2a2e:4200:be03:58ff:fe31:f74]) by smtp.gmail.com with ESMTPSA id fa1-20020a056000258100b0033af5716a7fsm37616wrb.61.2024.01.29.02.34.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 29 Jan 2024 02:34:06 -0800 (PST) Message-ID: Date: Mon, 29 Jan 2024 11:34:05 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: gcc-patches , Andrew Stubbs From: Tobias Burnus Subject: [patch] gcn/gcn-valu.md: Disable fold_left_plus for TARGET_RDNA2_PLUS [PR113615] Cc: Richard Biener X-Spam-Status: No, score=-8.0 required=5.0 tests=BAYES_00, BODY_8BITS, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, MEDICAL_SUBJECT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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 Andrew wrote off list: "Vector reductions don't work on RDNA, as is, but they're supposed to be disabled by the insn condition" This patch disables "fold_left_plus_", which is about vectorization and in the code path shown in the backtrace. I can also confirm manually that it fixes the ICE I saw and also the ICE for the testfile that Richard's PR shows at the end of his backtrace. (-O3 is needed to trigger the ICE.) OK for mainline? Tobias * * * PS: We could add testcase(s) that is/are explicitly compiled with gfx1100 and/or gfx1030 + '-O3' to ensure that this gets tested with AMDGPU enabled, but I am not sure whether it is really worthwhile. PPS: Running the testsuite, I see the following fails with gfx1100 offloading: FAIL: libgomp.c/../libgomp.c-c++-common/for-5.c (test for excess errors) Excess errors: /tmp/ccrsHfVQ.mkoffload.2.s:788736:27: error: value out of range .amdhsa_next_free_vgpr 516                                        ^~~ [Obviously, likewise forlibgomp.c++/../libgomp.c-c++-common/for-5.c] FAIL:libgomp.c/pr104783-2.c execution test FAIL:libgomp.c/pr104783.c execution test (The .log unfortunately does not show more details) FAIL:libgomp.fortran/optional-map.f90   -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions  (test for excess errors) FAIL:libgomp.fortran/optional-map.f90   -O3 -g  (test for excess errors) FAIL: libgomp.fortran/target1.f90   -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions  (test for excess errors) FAIL: libgomp.fortran/target1.f90   -O3 -g  (test for excess errors)Same 'out of range' as above. * * * Manual testing shows for the two execution fails: Memory access fault by GPU node-1 (Agent handle: 0x8d1aa0) on address (nil). Reason: Page not present or supervisor privilege. Interestingly, it only fails with -O1 or higher, for -O0 it works. Tobias gcn/gcn-valu.md: Disable fold_left_plus for TARGET_RDNA2_PLUS [PR113615] gcc/ChangeLog: PR target/113615 * config/gcn/gcn-valu.md (fold_left_plus_): Only define for !TARGET_RDNA2_PLUS. Signed-off-by: Tobias Burnus gcc/config/gcn/gcn-valu.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcc/config/gcn/gcn-valu.md b/gcc/config/gcn/gcn-valu.md index cd027f8b369..23b441f8e8b 100644 --- a/gcc/config/gcn/gcn-valu.md +++ b/gcc/config/gcn/gcn-valu.md @@ -4274,7 +4274,8 @@ (define_expand "fold_left_plus_" [(match_operand: 0 "register_operand") (match_operand: 1 "gcn_alu_operand") (match_operand:V_FP 2 "gcn_alu_operand")] - "can_create_pseudo_p () + "!TARGET_RDNA2_PLUS + && can_create_pseudo_p () && (flag_openacc || flag_openmp || flag_associative_math)" {