From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sonicconh5003-vm0.mail.kks.yahoo.co.jp (sonicconh5003-vm0.mail.kks.yahoo.co.jp [114.110.61.43]) by sourceware.org (Postfix) with ESMTPS id 0D4E33858D3C for ; Wed, 11 Jan 2023 04:20:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0D4E33858D3C Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=yahoo.co.jp Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=yahoo.co.jp X-YMail-OSG: F7elx_EVM1m8pUz6JodqjOWTSVJzgz17GlMexsh14qXsyycrqil7wRDO8VB9PH9 rdKG8uZ4By6xufV7BcswfeGZtRJGtaooB9Pwkn_yvNRQwEPbdoSAgzHQD_TS9uqFzDhkH0h.knuf EGZpz7sDq5ZsLu.Qx_XJjPXzeCJMdRiw3GIRsIzWC9QkBWQ5mnxdw2WN9LyXTz9g.pWGkoV_qYbf VlRUbcpK.bdbIY642HEfZyuuMGmOkUVYB2eEemy1TZ2jUVe2G.Bkv8YZlsjRMgND2M55jI83nxfC Vuh6CUJVPR_ddwZjwnfIFvvtD9ri8hAkPBXabUYo4dxETWH.vBj89b2Qx_RAw.qM80KPslRvWxpO BPTpEWSNbL0O0xNHtNIq_x5SGQdbuWEHHAQzLjlqvd1_D5I3ZtIo0SZO1LolXkFyzXteW2kWVP0l KHyqdy2ZWOB3f75pE_B7WKLcOfPM6ggbjUG.F8xpLJfecZYdi5e4nhzeL4qIgJG77dk4qcm1.RnT q.M40BS_HMn8mwPh0aH.8A8wodItMg4lWw7eOWwJGe663ULpJowqpufgcYf60XbxEWHpLcv_uzBY Q7Qzj23s6pidWZxllhRonq6oaB3zvrZXjkVlrlSJ.d5MbTZ1JJh579bcnj.6KpRb6q.lodAZWo6z Zu284MeK1S2KjYmQPP1mJTMvXIgi6GYzyZYHpOsLvrCIhuRFuQe_JToDnPctOIc27Av5yXhJuhrr LZ2FLUN4cEwVzltkU4qIZf54MWZxASDhX9xTmzkuXSTEy89m3PxyXb2YJGMPrOEcVqEDgpwJ._zd wv4amd3i0Of570RFsM5GuJq_wjNWllZqckzVzYhlAvl3Efkw29Cav_RqhXeuBbHH2CD9reTyOL8H A3n9pVAFBZaLve_8YwKVyOU82DzgbPsib0l461qapQBEksmBatqhRU8lC_bNnCZc29xwVDPV5Igb fVDyuoeE- Received: from sonicgw.mail.yahoo.co.jp by sonicconh5003.mail.kks.yahoo.co.jp with HTTP; Wed, 11 Jan 2023 04:20:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1673410848; s=yj20110701; d=yahoo.co.jp; h=Message-ID:Date:MIME-Version:To:From:Subject:Content-Type:Content-Transfer-Encoding:References; bh=Nyrf5xC2eoLuPy+xlXl9+tGCLltBrWBOfDszTgfdVh0=; b=nqUjCMUkO7Szc95i46OnLmWPXs9JATT8Nc/I1L76lDr5/+x1V1fCUe4yBbPuDixz lvuyo9PUJpYxbTn1a5xK1hhEyzpD6KUGCdw2N5wCWpbQwjajOjjz1+9e+Yx4Ga5XqRw MFucWvTWdFKCKDxH4vjno4jJ4mYpcJ99pjH6f/58= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=yj20110701; d=yahoo.co.jp; h=Message-ID:Date:MIME-Version:From:Content-Type:Content-Transfer-Encoding:References; b=spnzLs1bvZrW33ymRB7+oBmNoeeJVLxsaenBGqEfRUMQdYYzZo02uChLWQRzRiAb 7LkX2Vd2ZNHo84yfgKNdMh5hAAPqcMZAG14/WdZpvE8lUXoKKm9P1+c00cR5bOPeNsD wiTzxsUBQmpJsKKn3NUU8JavGvJgqRVeyY2QXiU4=; Received: by smtphe5006.mail.kks.ynwp.yahoo.co.jp (YJ Hermes SMTP Server) with ESMTPA ID 3f894a3f5b2d636d6ccb9d9c77814dcd; Wed, 11 Jan 2023 13:20:45 +0900 (JST) Message-ID: <076a3744-f608-6f31-7244-2bf7ab06cdb1@yahoo.co.jp> Date: Wed, 11 Jan 2023 13:20:42 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 To: GCC Patches From: Takayuki 'January June' Suwa Subject: [PATCH] ifcvt.cc: Prevent excessive if-conversion for conditional moves Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit References: <076a3744-f608-6f31-7244-2bf7ab06cdb1.ref@yahoo.co.jp> X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,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: Currently, cond_move_process_if_block() does the conversion without balancing the cost of the converted sequence with the original one, but this should be checked by calling targetm.noce_conversion_profitable_p(). Doing so allows us to provide a way based on the target-specific cost estimate, to prevent unwanted size growth due to excessive conditional moves on optimizing for size. On optimizing for speed, default_noce_conversion_profitable_p() allows plenty of headroom, so this patch has little impact. Also, if the target-specific cost estimate is accurate or allows for margins, the impact should be similarly small. gcc/ChangeLog: * ifcvt.cc (cond_move_process_if_block): Consider the result of targetm.noce_conversion_profitable_p() when replacing the original sequence with the converted one. --- gcc/ifcvt.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/ifcvt.cc b/gcc/ifcvt.cc index 008796838f7..a896e14bb3c 100644 --- a/gcc/ifcvt.cc +++ b/gcc/ifcvt.cc @@ -4350,7 +4350,7 @@ cond_move_process_if_block (struct noce_if_info *if_info) goto done; } seq = end_ifcvt_sequence (if_info); - if (!seq) + if (!seq || !targetm.noce_conversion_profitable_p (seq, if_info)) goto done; loc_insn = first_active_insn (then_bb); -- 2.30.2