From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x22f.google.com (mail-oi1-x22f.google.com [IPv6:2607:f8b0:4864:20::22f]) by sourceware.org (Postfix) with ESMTPS id EC8F63858C35 for ; Thu, 21 Mar 2024 14:45:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EC8F63858C35 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 EC8F63858C35 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::22f ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711032341; cv=none; b=flJVb9y36p/n3mRKhcElFArH3RQ15RzX9c7LBiz6FXQA6gQLNGYv8fXOUOPqICtXmFT9aJzFvEcmoRYWScMhSkslL6jO4FMdobet4c/AaXf8vno0MMWCseJtnk8wAyS9nGjw2968n3XeE+nFSCOMTDirQuWw8jpVQC2Tf+17Sw8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711032341; c=relaxed/simple; bh=oYyfBp1tKsiosPRWFpsM+nJVXlPO3kPN9MNjdvLEvSI=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=ffhOiroSQuYkI9sZV3YMPgErC0zPcqKZDm5USrqLUloyIi3RJJeWuMZl2lqkjJ92w0eoN7zgi4K5Fh1otEJDvuOaI3kbYuW+CDL+5Wfg50pMsVf11sAi7m0K+DNBsUwjkUBeWpOCt0/tD5iqc9iEBO7hQimImucL6d8BYfIqCrs= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-oi1-x22f.google.com with SMTP id 5614622812f47-3c3aeef1385so390362b6e.3 for ; Thu, 21 Mar 2024 07:45:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711032338; x=1711637138; darn=gcc.gnu.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=yysknXtGMoDNXyVawXgjEsBG6fHuojcvRAZWbbaeMuA=; b=mj2cVXJOaCEW0beGV83sxAY1lnOGyFJZaUqrJFAtOQvP4T6+zYhQMShdtOax1SMyfa 6lHdFBvfKVEs3cjBAaX65gLzBzHMeBR8sRV5eG/5b4LVdGvN6Ie6nx0G62iE49Ud6gPR wiDlfHsf0kpwDTuKkW7KSI/96gVHzDQ9jq+W65wjYKIHGGjWc0Z3iLgbQFt3wknxXEqn yo59GiYSRDdMeJza/6Cox1dXLx2YqXACU509vsqUTTJpUX+YLZNOO5T/qVgN/snQL8ws AOfTKdiArmGgsEYxwNlJDLVP8TSM7KDxYF/zpvnEnwh4THzPvlE1Z3h6ZliK667pIDdc LgAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711032338; x=1711637138; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=yysknXtGMoDNXyVawXgjEsBG6fHuojcvRAZWbbaeMuA=; b=JXf2Xgs2GsK5EUms5wRhV4JSlO1XCVXmmir0kSSTnkxWneLpnITPq07yflTrhEgnFx n1gOHwH+XspN92atJN1FObqUNt/s0QVDUoUHLYABm0ikC0sYS1SOrLpMWQHyeFvKgWPw qLUYZfGipH/cdVPy+sFtyNNXojVZJFaLM75TrctvHvEhYvxKIKbWm+rgV26VhYTbzYNN brMrPNkcc2YlT+kFW45+LUuvRVv1MEa29QZEs6XRFeSKCUNUZcV/DZjHGpcqvnMrKICO XSuJGVKh8QH1hBGkKHPPozEdKvuPad6qBU1mJvnvSPXNx4QYLrTHO0m/jB5AqWHDasAD V5+g== X-Forwarded-Encrypted: i=1; AJvYcCW8J39dhNeSlME0BSvKf9ixWQvlq/ia6f6NRxNuQzIM8KQ52RxCngcgYWqydPur7Jw5ccccUFPUt9oLlhGYul+H0dW7Sm1eOQ== X-Gm-Message-State: AOJu0YxqtWlvDJlInd3LjPgiirtQ002r9nuPeUHpDtOlZzywATqhAU3g 3GFRmPvECwGGXcmvTIKyu6vGauzQVZLl6xpJboFKuRWurukvZgdm X-Google-Smtp-Source: AGHT+IFmBixlEEa0AgJJVNHl8++1U2VkQsHz/Qx1e33qgpTkDoeMIx+Er4ZpJ/o6KAKIpDY+QuTBTw== X-Received: by 2002:a05:6808:309d:b0:3c3:a82c:7575 with SMTP id bl29-20020a056808309d00b003c3a82c7575mr2570436oib.54.1711032338110; Thu, 21 Mar 2024 07:45:38 -0700 (PDT) Received: from [172.31.0.109] ([136.36.72.243]) by smtp.gmail.com with ESMTPSA id l12-20020a056808020c00b003c3af0b1cefsm158972oie.44.2024.03.21.07.45.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 21 Mar 2024 07:45:37 -0700 (PDT) Message-ID: <3faf0264-7b82-4574-bb45-df66d77421be@gmail.com> Date: Thu, 21 Mar 2024 08:45:36 -0600 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Beta Subject: Re: scheduler queue flush (was Re: [gcc-15 0/3] RISC-V improve stack/array access by constant mat tweak) Content-Language: en-US To: Vineet Gupta , gcc-patches@gcc.gnu.org Cc: kito.cheng@gmail.com, Palmer Dabbelt , gnu-toolchain@rivosinc.com, Robin Dapp References: <20240316173524.1147760-1-vineetg@rivosinc.com> <2acab452-4dc0-4782-aedf-8495d84d7374@rivosinc.com> From: Jeff Law In-Reply-To: <2acab452-4dc0-4782-aedf-8495d84d7374@rivosinc.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,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 List-Id: On 3/21/24 8:36 AM, Vineet Gupta wrote: > > > On 3/18/24 21:41, Jeff Law wrote: >> >> On 3/16/24 11:35 AM, Vineet Gupta wrote: >>> Hi, >>> >>> This set of patches (for gcc-15) help improve stack/array accesses >>> by improving constant materialization. Details are in respective >>> patches. >>> >>> The first patch is the main change which improves SPEC cactu by 10%. >> Just to confirm. Yup, 10% reduction in icounts and about a 3.5% >> improvement in cycles on our target. Which is great! >> >> This also makes me wonder if cactu is the benchmark that was sensitive >> to flushing the pending queue in the scheduler. Jivan's data would tend >> to indicate that is the case as several routines seem to flush the >> pending queue often. In particular: >> >> ML_BSSN_RHS_Body >> ML_BSSN_Advect_Body >> ML_BSSN_constraints_Body >> >> All have a high number of dynamic instructions as well as lots of >> flushes of the pending queue. >> >> Vineet, you might want to look and see if cranking up the >> max-pending-list-length parameter helps drive down spilling. I think >> it's default value is 32 insns. I've seen it cranked up to 128 and 256 >> insns without significant ill effects on compile time. >> >> My recollection (it's been like 3 years) of the key loop was that it had >> a few hundred instructions and we'd flush the pending list about 50 >> cycles into the loop as there just wasn't enough issue bandwidth to the >> FP units to dispatch all the FP instructions as their inputs became >> ready. So you'd be looking for flushes in a big loop. > > Here are the results for Cactu on top of the new splitter changes: > > default : 2,565,319,368,591 > 128 : 2,509,741,035,068 > 256 : 2,527,817,813,612 > > I've haven't probed deeper in generated code itself but likely to be > helping with spilling Actually, I read that as not important for this issue. While it is 50b instructions, I would be looking for something that had perhaps an order of magnitude bigger impact. Ultimately I think it means we still don't have a good handle on what's causing the spilling. Oh well. So if we go back to Robin's observation that scheduling dramatically increases the instruction count, perhaps we try a run with -fno-schedule-insns -fno-schedule-insns2 and see how the instruction counts compare. Jeff