From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [IPv6:2a00:1450:4864:20::22b]) by sourceware.org (Postfix) with ESMTPS id 314703858435 for ; Wed, 22 Nov 2023 11:14:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 314703858435 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 314703858435 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::22b ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700651696; cv=none; b=WdFXwO7+ytp3xY+5oWO/Oc6DAXGJQY2p/DMWMVZ32oEFhpqsFYyUb1cDcjmydp1gCY32ASC5Dkme1zZ+wQ0m3Q1oPJO3ILJ/tq2IyHdpTfTq8UaxzMmGag3pYN40rWO7w/EQKRwtzQh+df2+JhrKB4/iVdYoExjh4octwjVMxOc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700651696; c=relaxed/simple; bh=AuJZtOW48jq9UNt06p2ROFFyLCsAX4SAsqEfAna4l2Y=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=ERZJeCKkfqVJ/FLHS50RowMlK6irJxhxOXfdjzrnzfuj2ChAfcqVKDZCYNCZLqP0B80KWEwZ95nQBhUkVxFOgAgiOtc4BMXioo9aCmP2SxbPOBEVgG8OSur+Uw3mtW3e6ZrWOroXDQb+IzUkMBxtt8N8lUDnuwV0+UDUd/Bem5k= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2c87acba73fso8297331fa.1 for ; Wed, 22 Nov 2023 03:14:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700651684; x=1701256484; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2Ixty20xXYBflwvDRXfnPF/YxrSyiYMmdyR9HO3Oszs=; b=VJi0oyv2lsBjHXVcOYP4znVffRrGEpgaYjGIiVmkwPeHxzfFTjulMk1sALLKXy8WCu EqlMrNDbYyGaKXku5Tle0iQ7JWwDc9dfXJeJE+zQXKFWVnrFtuiDPHVRzYdhYwO4zaM7 +mrNo0rrjI4Qk66XdNP6y+Zzk2Wyj7xj+Y9QueEYv5ERvUzimwlYagXI4IYTcKaRRO5E bWvcKkqakTHpaaYlez32H9axSxU4rXlokbMhr+5HIUmUl2XKJKi+RmnlZCaptRdpvmH0 ANK2LsygTL9SxVTCSugj9HFyeYgNEsMwwsmGBI1EGb90ofzcZRv4TRJWRwGFfXmSjwtg oXyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700651684; x=1701256484; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2Ixty20xXYBflwvDRXfnPF/YxrSyiYMmdyR9HO3Oszs=; b=DZZL3mMjUlccsTPQeFxNcPo3+IsOb7WsPtCkY4nZ7ksEs86/J3ojscXAxgaoRRzmss AZuM7YNjewg46/oXcLUab4ezKp/JhAB1mZhq58aZstw/ki4a9w/uwK66CCsfmkBanAmt Rq29TA/5jtrTyIt5f6DiuTmeRL+JIXyBnTMjkfZC+EK/fZ5vQTMhQnLgzBS//TntTVyD YdiMihzoY9q9RZCTtsKcoATNq7L8pkueqaN+Rc1FAjGUALMtu8Bhzw+h1nFLatoZc/fz HbnC5X6qfSGvF4d9gAITCn/0xbSMvsmNOGUi1pGyXMbMRi4tZQzjmyvvACmxm3QMjPyw al8w== X-Gm-Message-State: AOJu0Ywd63g3cxjH0fw1Z0WlV0b4/wAdsq32BHiuVCdqPch3+PhSYIMB 5OxcGLFZUA7BmwVG1bmZNWtX2uJBIajvG+X1DUAv X-Google-Smtp-Source: AGHT+IE5eXFGJWmKcLDLBibJwmVXLkXmP8JoBa1uQhp/HjN24oVlMsGhxcfK538Yr/3o2a6emnxHeA== X-Received: by 2002:a05:6512:23a7:b0:50a:bacb:5b74 with SMTP id c39-20020a05651223a700b0050abacb5b74mr1147995lfv.4.1700651683645; Wed, 22 Nov 2023 03:14:43 -0800 (PST) Received: from localhost.localdomain (static.225.72.216.95.clients.your-server.de. [95.216.72.225]) by smtp.gmail.com with ESMTPSA id t13-20020a195f0d000000b0050919538b00sm1848553lfb.79.2023.11.22.03.14.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 03:14:42 -0800 (PST) From: Maxim Kuvyrkov To: gcc-patches@gcc.gnu.org Cc: Maxim Kuvyrkov , Bernd Schmidt , Vladimir Makarov , Jeff Law , Alexander Monakov , Richard Guenther Subject: [PATCH v3 0/8] Avoid exponential behavior in scheduler and better logging Date: Wed, 22 Nov 2023 11:14:07 +0000 Message-Id: <20231122111415.815147-1-maxim.kuvyrkov@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231120120649.672893-1-maxim.kuvyrkov@linaro.org> References: <20231120120649.672893-1-maxim.kuvyrkov@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_SHORT,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 List-Id: Compared to v1 and v2 this is a complete patch series. The debugging/dumping improvements gently touch IRA, RTL lists, and sel-sched bits to avoid re-inventing or copy-pasting the wheel. Bootstrapping and regtesting these patches on aarch64-linux-gnu. OK to merge? Thanks! === This patch series fixes exponential behavior in scheduler's find_modifiable_mems(). This fixes PRs [1] and [2], which are compilation time and memory hogs. The first patch in the series is the actual fix (bootstrapped and regtested on aarch64-linux-gnu), and follow up patches are improvements to scheduler's logging infrastructure, that enabled me to debug this problem. As-is, the scheduler has good logging of the actual scheduling process, but calculation of instruction dependencies has almost no logging. [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96388 [2] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111554 Maxim Kuvyrkov (8): sched-deps.cc (find_modifiable_mems): Avoid exponential behavior Unify implementations of print_hard_reg_set() Simplify handling of INSN_ and EXPR_LISTs in sched-rgn.cc Improve and fix sched-deps.cc: dump_dep() and dump_lists(). Add a bit more logging scheduler's dependency analysis sched_deps.cc: Simplify initialization of dependency contexts Improve logging of register data in scheduler dependency analysis Improve logging of scheduler dependency analysis context gcc/hard-reg-set.h | 3 + gcc/ira-color.cc | 17 +- gcc/ira-conflicts.cc | 39 +---- gcc/lists.cc | 30 +++- gcc/rtl.h | 4 +- gcc/sched-deps.cc | 399 +++++++++++++++++++++++++++++++++++++++--- gcc/sched-int.h | 9 +- gcc/sched-rgn.cc | 56 +++--- gcc/sel-sched-dump.cc | 21 +-- gcc/sel-sched-dump.h | 2 +- 10 files changed, 467 insertions(+), 113 deletions(-) -- 2.34.1