From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25133 invoked by alias); 24 May 2018 00:33:18 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 25124 invoked by uid 89); 24 May 2018 00:33:17 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.7 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-spam-relays-external:ESMTPA X-HELO: resqmta-po-05v.sys.comcast.net Received: from resqmta-po-05v.sys.comcast.net (HELO resqmta-po-05v.sys.comcast.net) (96.114.154.164) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 24 May 2018 00:33:16 +0000 Received: from resomta-po-13v.sys.comcast.net ([96.114.154.237]) by resqmta-po-05v.sys.comcast.net with ESMTP id LdxAfEWkQi5lcLeBvfFFZ5; Thu, 24 May 2018 00:33:15 +0000 Received: from [192.168.10.125] ([73.60.223.101]) by resomta-po-13v.sys.comcast.net with ESMTPA id LeBufzeT1qDpKLeBufadB8; Thu, 24 May 2018 00:33:15 +0000 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.3 \(3445.6.18\)) Subject: Re: How do I stop gcc from loading data into registers when that's not needed? From: Paul Koning In-Reply-To: Date: Thu, 24 May 2018 00:33:00 -0000 Cc: Segher Boessenkool , GCC Development Content-Transfer-Encoding: quoted-printable Message-Id: <7B2B2AAD-9A14-42AD-B05F-0447178E4BC8@comcast.net> References: <018C29D6-6245-4D31-B43B-623E080A6F87@comcast.net> <20180522192609.GQ17342@gate.crashing.org> <50B057F6-F0AB-4213-91DE-2A988C72436F@comcast.net> To: Richard Biener X-CMAE-Envelope: MS4wfH/jSRJCto/JIu+G/x9WTW81YnOmd0NnyJqd0tV4ch5FxNexUZn0R+sKRtsJ+QLmjLUQriwAY7QcOSLgZAAK+acbhGtubL31fVlcL56k4xRYoGN+lk5s mNn49Je6AChJ/ccNp40u9OP5YhXiytv3DVBApD45RCP9oETxWwuHhFORTpckj4vTu9oFu7IuW0VESAucZK2Xh3nzM+uKtbRmmh35id0FOQ0vhqq0EXGAjDQ/ 0FPgLbHvcLCclfkIv6/oMA== X-SW-Source: 2018-05/txt/msg00210.txt.bz2 > On May 23, 2018, at 5:46 AM, Richard Biener = wrote: >=20 > ... >=20 >> 2. The reported costs for the various insns are >> r22:HI=3D['x'] 6 >> cmp(r22:HI,r23:HI) 4 >> cmp(['x'],['y']) 16 >> so the added cost for the memory argument in the cmp is 6 -- the same >> as the whole cost for the mov. That certainly explains the behavior. It >> isn't what I want it to be. Which target hook(s) are involved in these >> numbers? I don't see them in my rtx_costs hook. >=20 > The rtx_cost hook. I think the costs above make sense. There's also a > new insn_cost hook but you have to dig whether combine uses that. > Otherwise address_cost might be involved. Thanks. For a pdp11, those costs aren't right because mov and cmp and=20 a memory reference each have about the same cost. So 8, 4, 12 would be=20 closer. But the real question for me at this point is where to find the knobs that adjust these choices. The various cost hooks have me confused, and the GCCINT manual is not really enlightening. There is rtx_costs, insn_cost, and addr_cost. It sort of feels like insn_cost and addr_cost together would provide=20 roughly the same information that rtx_costs gives. In the existing=20 platforms, I see rtx_costs everywhere, addr_cost in a fair number of targets, and insn_cost in just one (rs6000). Can someone explain the interaction of these various cost hooks, and what happens if you define various combinations of the three? paul