From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by sourceware.org (Postfix) with ESMTPS id D1E923858C78 for ; Sat, 22 Jun 2024 13:15:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D1E923858C78 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 D1E923858C78 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::12c ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1719062134; cv=none; b=DXQH2Zdy8Vuh10KNWO/FiJ2lKJNspa6JAGW4ocqd0/rFPy198Q/TVq/7DCNi/uhNy+WIgPomvRiLCwW95fVuF0ZrSmY+AR+ByPPl4LrdgqUc1VU1U4o/zEG6dW/GrQD3mxDzTLJZrzvOziBFTkfcT77pMVxQoSoc/A2XdaR5qY4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1719062134; c=relaxed/simple; bh=/hLqqjbu5HoEF4mfp2YOQ+CNUJOdfK7ndi6VnWn8ZA0=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=Kh26xj5A4z/ATLlQjxbilubPS88unyDE5fNqimfHXQ9NOvHi9K1SCHc3Yim8dTgsrXDH1M/VNuVnSZSD8R/TH3go9S00xfsG22x1JYS+7Y/e2hxoB34BVxjJTLtd1tzeV5nrkO5/uQ71iobSabfi3k5OiYmziSV4uIe4oEw9Ph4= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-52cc671f170so3428237e87.1 for ; Sat, 22 Jun 2024 06:15:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719062129; x=1719666929; darn=gcc.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=wpDkZU0bpKhwKIBDnH+85iMHOEEmO1lQKu+9M6GXPtk=; b=iuvS7+MMmMW2aV6CM8Tp7quU7Xd5sQ5TzHCafleFQaqSCUCOzx5oc1DKEChg9aFAAV WSH2kHq439n2Ao+7vjCFlUHGZggIlzbzbXB6YrkmoDUX9DeHbPn857GoUXevPEXP8KJV FeOiOFT8wpSNsz3pVlLjHI3vau3sVm2/YgOs0pl6g428h1G0AY8+r7WOcbXlF45FdRkx jZVuyJkQ4Ar3rjRUlw9CeTO0na/iZP3uWLdTlJ8OVaq9yrcKKozy8fComXY8CSKwphLd qN6z+Zn1MIDNN9vRkU6GYcj9MjFDo1kmw7zBPQQO23d6XozkNOYjxxtF8OO9KAnGcZ1M WCZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719062129; x=1719666929; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wpDkZU0bpKhwKIBDnH+85iMHOEEmO1lQKu+9M6GXPtk=; b=LIpSuKXZcuWDhnkQvFfOC7eP96kl67b3D8hNHMQxX2W7qEupjlPzaG3ucez99/QitV +cAzivw3JzOPQvXmC0IbCQQinh0uIR/bZBBqe8dmyC7dctdAwZEB+T8ytD/H9FMBMA6v tEC4J5fZiYawWyVT0moqJy2hdkoyqgJKwVJPFGwoY2PWm4dgo/XB0bFVBKOmLBPKBj3Z 9Oi8ewGxUNz+p3nDOLiI+GaoqISN15ctyV+q1Xob1NvZiFeh81pdJfCiAQGjoPKnd28V nscSkMiHShdyD/RASnl+rUi/+L+k6wCaJ7yl+cIPgeePcGFBgviNKfvTYMG4ASxAXlts /yLw== X-Gm-Message-State: AOJu0Yz5zD84HRF4IsHChhIJecZ7wRzrbarFrgX2arXCshQWVuDFjHQA J9VbLw9rs+Diw+n/I4dWZ0OfZB4Nc9ashe8aokQdmHbquQEdOZAgQeWJrKrJswMNsY4CVg5kAom nBXYe2POtd2xtzh7OjeMaanedsLw= X-Google-Smtp-Source: AGHT+IF4Ja7Nj+ngkN/b+b/PScMwkObKmgia+EoLPyQARIFVVIlXx+zyYHmrzlpw/TVylJ+2SlpupykEL1ltbslMHpQ= X-Received: by 2002:a05:6512:73:b0:52c:c779:a025 with SMTP id 2adb3069b0e04-52cdf345fcbmr368567e87.15.1719062129250; Sat, 22 Jun 2024 06:15:29 -0700 (PDT) MIME-Version: 1.0 References: <1bb04945-d13b-4805-b9ed-0be4a5c773fc@redhat.com> In-Reply-To: <1bb04945-d13b-4805-b9ed-0be4a5c773fc@redhat.com> From: Richard Biener Date: Sat, 22 Jun 2024 15:15:18 +0200 Message-ID: Subject: Re: [PATCH] Add param for bb limit to invoke fast_vrp. To: Andrew MacLeod Cc: gcc-patches , "hernandez, aldy" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,KAM_SHORT,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 Fri, Jun 21, 2024 at 3:02=E2=80=AFPM Andrew MacLeod wrote: > > This patch adds > > --param=3Dvrp-block-limit=3DN > > When the basic block counter for a function exceeded 'N' , VRP is > invoked with the new fast_vrp algorithm instead. This algorithm uses a > lot less memory and processing power, although it does get a few less > things. > > Primary motivation is cases like > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D114855 in which the 3 VRP > passes consume about 600 seconds of the compile time, and a lot of > memory. With fast_vrp, it spends less than 10 seconds total in the > 3 passes of VRP. This test case has about 400,000 basic blocks. > > The default for N in this patch is 150,000, arbitrarily chosen. > > This bootstraps, (and I bootstrapped it with --param=3Dvrp-block-limit=3D= 0 > as well) on x86_64-pc-linux-gnu, with no regressions. > > What do you think, OK for trunk? + if (last_basic_block_for_fn (fun) > param_vrp_block_limit || + &data =3D=3D &pass_data_fast_vrp) || goes to the next line. Btw, we have -Wdisabled-optimization for these cases which should say sth like "function has excess of %d number of basic blocks (--param vrp-block-limit=3D%d), using fast VRP algorithm" or so in this case. As I wrote in the PR the priority should be -O1 compile-time performance and memory use. Richard. > Andrew > > PS sorry,. it doesn't help the threader in that PR :-( It's probably one of the known bottlenecks there - IIRC the path range queries make O(n^2) work. I can look at this at some point as I've dealt with the slowness of this pass in the past. There is param_max_jump_thread_paths that should limit searching but there is IIRC no way to limit the work path ranger actually does when resolving the query. Richard.