From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by sourceware.org (Postfix) with ESMTPS id EBC5A3857006; Sun, 5 Jul 2020 11:15:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org EBC5A3857006 Received: by mail-wr1-x433.google.com with SMTP id z2so15436530wrp.2; Sun, 05 Jul 2020 04:15:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:user-agent:in-reply-to:references :mime-version:content-transfer-encoding:subject:to:cc:from :message-id; bh=deIe0oq+6GgWmvmr3XpDeJjRV5qg5+kE8L78MIPV8VQ=; b=YgU52blfeNkknMcaY5tOn5GGBMlaPXRsDeuKt421gNSO9B0RtXcQ3sQrx4cI+qcQ2d OVdKiQmmSxiHvunz3Qe9YwSCNeIyWEopRaL0a10D2BV3FYv9OB/IrmkRnAD2bbgGXgDL 7EoMzkLcx1rATFowerzkBcNYyNhCe5WBU1+gSttmKzXRRgUzxEbuoym7Sei5xEbEZY7y eCsgXJjdWEuzWWt9IGwyapB6ni8fBDLk/vw4dT3XnxkkcDlHBDtWqOpqo6WJX3BQes7P WReNUnHcuPrpXmy5pAjYHUnVftnaZMvnHp+hUN2e3Vt7+gx5u5LvZpMAnT8ZBpiboaTd Oxeg== X-Gm-Message-State: AOAM531GaaCbzXkTGc5Gqs9ulshdfUBwMFHD8aOvP1K0lr60h1dn2Uqf Zxuw/eCL/YzkILRjk0dA/gg= X-Google-Smtp-Source: ABdhPJwcTvsXyV8veFFe53NSNjSH+hEscMzhMJvOTYpbM3u9bGX+jW7AuG61Zn1U1d64eK7sIvXTfg== X-Received: by 2002:a5d:6342:: with SMTP id b2mr43704389wrw.262.1593947741832; Sun, 05 Jul 2020 04:15:41 -0700 (PDT) Received: from [192.168.178.32] (x5f7215b1.dyn.telefonica.de. [95.114.21.177]) by smtp.gmail.com with ESMTPSA id c25sm7497048wml.18.2020.07.05.04.15.41 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 05 Jul 2020 04:15:41 -0700 (PDT) Date: Sun, 05 Jul 2020 13:15:39 +0200 User-Agent: K-9 Mail for Android In-Reply-To: <3FC4FEE9-17E1-4762-9513-921A92CC1278@tkoenig.net> References: <3FC4FEE9-17E1-4762-9513-921A92CC1278@tkoenig.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: Local optimization options To: =?ISO-8859-1?Q?Thomas_K=F6nig?= CC: gcc mailing list ,gfortran From: Richard Biener Message-ID: 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_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jul 2020 11:15:46 -0000 On July 5, 2020 12:37:58 PM GMT+02:00, "Thomas K=C3=B6nig" wrote: > >> Am 04=2E07=2E2020 um 19:11 schrieb Richard Biener >: >>=20 >> =EF=BB=BFOn July 4, 2020 11:30:05 AM GMT+02:00, "Thomas K=C3=B6nig" > wrote: >>>=20 >>> What could be a preferred way to achieve that? Could optimization >>> options like -ffast-math be applied to blocks instead of functions? >>> Could we set flags on the TREE codes to allow certain optinizations? >>> Other things? >>=20 >> The middle end can handle those things on function granularity only=2E= =20 >>=20 >> Richard=2E=20 > >OK, so that will not work (or not without a disproportionate >amount of effort)=2E Would it be possible to set something like a >TREE_FAST_MATH flag on TREEs? An operation could then be >optimized according to these rules iff both operands >had that flag, and would also have it then=2E Since -ffast-math has effects on operations (-freciprocal-math) and on Operands (-fsignalling-nans) I think we'd need both and a single flag isn'= t enough=2E=20 I guess parts of -ffast-math could be represented on a per stmt basis alre= ady, -fno-trapping-math for example could be TREE_NO_TRAP and the correspon= ding gimple flag=2E And yes, it would be very desirable to have all semantics fully represente= d in the IL rather than influenced by global flags=2E But then also optimiz= ation passes have to be careful to track state on that level=2E=20 Richard=2E=20 > >Regards, Thomas